"Cooties" is supposed to prevent children from forming relationships with the opposite sex at a young age that would then cause them to consider them like siblings and prevent them from possibly mating in the future. When children are put in a novel environment, like a mixed-gendered school, they feel disgusted by the opposite gender to prevent them from forming bonds that would exclude them as sexual partners in the future.
My working theory is that my AGP was caused by "cooties" or more accurately, a sense of disgust that was supposed to prevent me from seeing the little girl I was spending time with as a sister, so I would be able to potentially mate with her in the future. The combination of juvenile disgust and heterosexual attraction gave me a notion that if I spent time with this girl (who I was attracted to) I would become a girl, and that is something I should avoid.
I believe that AGP belongs in a class of fetish that is related to disgust. Coprophilia (skat fetish), podophilia (foot fetish), and acrotomophilia (amputee fetish) might also be disgust related fetishes. TiFs also report feelings of disgust as motivation to transition.