Please forgive the long post.
The pants are not the basic seat of whether someone is male or female, and in any case, surgery can change what is visible and obvious. It looks as though a lot of people missed an important part of the sex education lessons at school - maybe they were dreaming of field trials with their favourite study partner.
Every single cell of every organ or process in the human body contains all their DNA, with one exception. That exception (actually two exceptions, one in the female, one in the male) creates new individuals.
The double twisted chains of DNA reproduce themselves for growth and replacement of cells by all untwisting, separating into two groups at either end of each cell, and there reconstructing the missing halves of themselves and retwisting with them into perfect copies of the original. Think two-ply wool where each ply is a different colour, but if untwisted each can create a strand of the other colour to twist with.
The exceptions are the cells produced in the ovary or testes. (the eggs in a female, the sperm in a male) these do not replace the missing half with a copy of what was there originally They are still incomplete.
So each only has half of the instruction manual - a sperm cell has to meet up with an egg cell and fuse with it for them to have all the info to copy, divide and copy divide again, and differentiate to make a fetus and in due course a baby.
The egg cell half-DNA that came from the mother has an X chromosome, whichever half it is, (as she inherited two, either one from her mother, or one from her father), but those from the father have either a Y (from his father) or an X (from his mother)
The bottom line is that the evolutionary purpose of male and female versions of human beings is reproduction. Without those differences, there would be no human race. It would have been "Hi Eve, I'm Adam" and then no more. This is not an airy-fairy philosophical theory about the importance of being of one sex or the other to the psyche of the individual, or a religious conviction that "God made it so and we shouldn't meddle". It is a basic requirement for the very existence, not only of the whole human race, but also of those individuals who feel themselves to be nearer the persona of the opposite sex than to the one they were born into.
Whatever someone does to alter their external sexual organs or their internal hormones, their appearance, their voice, their interests, attitudes, occupations, everything, their unchangeable sex is in whether they produce large gametes (eggs) or small gametes (sperm) ( or whether they would do so if a problem/fault didn't exist in the development of the organs that do that production.)
This is why a lot of people who have no beef with anyone preferring to look, act, think, feel and generally be considered to be of the other sex still insist in saying that trans people are welcome to live as they want - and wish them a happy and fulfilled life - but they are still the male or the female human that they were conceived as.