In the Categories, Aristotle gives the example of Socrates' knowledge of grammar for something that is 'present in' a subject, i.e. inseparable from it. That makes sense to me: if Socrates dies, his knowledge of grammer dies. But I'm wondering what Aristotle would say, for example, about the knowledge of geometry, which is an abstract body of truths about mathematical objects. Surely that kind of knowledge is universal and does not require to be present in something for its existence? What is the way an Aristotelian would think about a priori knowledge and the possibility of its existence independent of any knower?
I think you may have got the wrong handle on Aristotle. His point is that Socrates is a substance, and knowledge of grammar as a quality must belong to a substance. A substance can exist independently but knowledge, or any quality, requires a substance of which it can be predicated - to which it can belong. A quality - knowledge of grammar or anything else, redness, beauty - is not free-floating : it has to be a quality of something, namely a substance.
Knowledge of grammar is not inseparable from Socrates; that is not the point at all. He would still be Socrates even if he lost his memory. Aristotle is only saying that if there is knowledge of grammar it cannot exist independently - separably - from a substance that has it. In the case of Socrates it is 'present in him' just as it is present in Plato and Aristotle and virtually every Greek citizen.
In whatever way the truths of geometry exist, it is only the knowledge of geometry that is present in individuals such as Socrates. Socrates' knowledge disappears with his death; the truths of geometry are unaffected. If there is knowledge of geometry it cannot exist outside particular subjects - individuals, substances - because knowledge is a quality that requires a subject to which it can be attributed. In this respect the knowledge of grammar and the knowledge of geometry are no different.