They've actually found that trans individuals have brain structures that match their identity rather than their sex at birth.
So while the way genders are supposed to act is a social construct, gender is very much biological as well.
The truth is at this stage we don't fully understand it.