I've found a way to retrieve the Text Scaling Factor, without installing any Nuget packages. The idea is to obtain the value directly from the registry.
var userKey = Microsoft.Win32.Registry.CurrentUser;
var softKey = userKey.OpenSubKey("Software");
var micKey = softKey.OpenSubKey("Microsoft");
var accKey = micKey.OpenSubKey("Accessibility");
var factor = accKey.GetValue("TextScaleFactor");`