The one example I know of would be "2 spirit" people in Inuit society, but they're not anything like modern trans people. (I know 2 spirit is used by other indigenous groups to mean different things, but I have no idea of the historical validity behind it.)
Basically, a newborn baby would be considered the second life of someone recently departed, regardless of sex. The baby would be raised as the sex of the departed person until puberty, then usually (though not always) return to their birth sex social role.
And though there's spirituality in the explanation behind this, it tended to be based on need of social roles as well. If a family has 7 baby girls in a row, one of the younger ones would be more likely to be 2 spirit because they'd need someone to fill the male social role, and vice versa.
This is very much an assigned at birth thing, not 30 year old men deciding it makes their weiners feel good to dress like women.
en.m.wikipedia.org