Hmm, right now, it's actually a bit of a toss-up. If whatever mod edits stack sizes happens to load before this one, then it will use the new number in its calculations; otherwise, it will use the vanilla numbers. At least, if they do so in data-final-fixes (which I would lol). But yes, it is reading the numbers directly from the game itself; they are not hard-coded.
I should probably go around and take a tally of mods that edit stack sizes, adding them as optional dependencies, just to make sure they get loaded first.