Gender is rooted at birth and we can thank the unfortunate story of David Reimer for developing our understanding of this. He became the perfect case study for how social rearing cannot scrub basic biological wiring. No matter how much his parents insisted, David felt like a boy because he was one. Dr. John Money of the John Hopkins Institute got it wrong and you could not socialize a gender identity into a person.
This is how today we can know that transgender people are telling the truth when they speak of a lack of conjunctiveness with their birth sex. Socialization might kick in but they are not able to make sense of the internal feelings versus an expectation to behave in a manner that often runs counter to instinct. Children know what gender they are from a very young age and they don't need to be told because it is simply already part and parcel of their intrinsic programming.
Therefore, the best thing we can do is get out of their way and let them develop as they are; no coaxing and no cajoling. This means that the days of barbaric conversion therapy a la Kenneth Zucker certainly no longer have a place in this world.