In evaluating the sexually dimorphic REGIONS of the brain, it turns out that only about 6% of the population have a representative set of 10 regions that are all aligned with a particular gender. (This is an interesting clue towards a biological explanation of folks being nonbinary in their identities or orientations, but is really just a clue. Correlation does not prove causation, and all that.)
There are pinpoint sexually dimorphic locations that provide a very strong correlation between representative gender and gender identity, and do not have significant overlap between genders. These locations are places like the bed nucleus of the stria terminalis, and have been interpreted in analysis of brain tissues after death. They are at the current limits for high resolution fMRI imaging.
A set of scans that can 'prove' someone is transgender or act as a reliable diagnostic are not quite here yet.
If we ever do reach this point, it makes me a little nervous that identifying such a specific structural variation might inspire someone to develop a 'cure' by tinkering with brain structure so that it looks 'correct' in a scan. If such a surgery were attempted, I suspect the damage or death of personality that would result would be undesirable for many of us. The social pressure to be so 'fixed' would also be enormous in this culture, however. I would view such a 'correction' as little more than suicide.