The structure of the brain itself. There have been a few lines of research but to highlight a couple: there have been hormonal tests of fetuses while in the womb and autopsies of people who identified as transsexual. Forgive me for not providing links but I've done this too many times; to be honest I should have made a cut and paste about this years ago (and I just don't care to do it now).
I'll start with the autopsies, it was found that people that identified as transsexual had brains that were structured like that of the gender they claimed to be. Once a few studies were conducted, one of the criticisms was that the transsexuals might have had some amount of change of brain structure by taking hormones. At that point, further autopsies were done that accounted for hormones, and it was found that even without any real treatment, such as hormones, these transsexuals still had brain structure consistent with the gender they claimed (male body with female brain or female body with a male brain structure).
As for hormones, studies were done on mice (the one I'm most familiar with) where they were dosed with the opposite gender hormones to their DNA at a key point in development. When they did this, the mice acted "transsexual" -- where male mice behaved as if they were female and females behaved as if they were male. Obviously no human trials have been done, though in the 50s (and even into the early 60s) women were sometimes given hormones to prevent them from miscarrying. There was a bit of research done on male children that found an abnormally high number that identified as transsexual -- but it was a rather small study due to difficulty in finding the children, 40+ years later.
Last, a couple of interesting new lines of study. Studies of areas polluted by estrogenic chemicals (such as runoff of fertilizer and pesticides into watersheds) show abnormally high level of "transgender" behavior from the animals in those areas. In fact, there are some new lines of research that appear to show that it is happening in humans, as well, though a lot more work is needed there. Additionally, there have been studies into the human genome that suggest there are alleles inside the genome that may account for homosexuality and transsexuality, though a lot of work still needs to be done here.
You can't easily diagnose it because of the issue of trying to view the structure of the brain. We can tell with an autopsy but that isn't a good diagnostic method for living people.