Ardhanarishvara, the “totality that lies beyond duality”, is a fusion of the Hindu deities Shiva and his wife Parvati. The full mythology surrounding Ardhanarishvara is vast, stretching through multiple religious texts and several cultures, but there are commonalities among the varying accounts: Shiva and Parvati share one body, with Shiva on the right and Parvati on the left; and their union is meant to symbolize a divine (and healthy) balance of masculinity and femininity. One of the more striking origin stories for Ardhanarishvara comes from Tamil: There was a priest who worshipped Shiva but refused to venerate Parvati, which outraged her. She tried to humiliate him by turning him into a skeleton, but Shiva gave him an extra leg so he could stand and so escaped his humiliation. Shiva and Parvati then fused together, and the priest escaped the dilemma of having two gods in one to worship by turning into a beetle and burrowing into Shiva’s half of the body.
Deities who are in some way androgynous or intersex are common in mythologies worldwide due to the associated symbolism of creation and fertility. Depictions vary broadly, but there are several described in Wikipedia’s page on LGBT themes in mythology as transgender or intersex. However, a god composed of two different people who can join together and split apart at will has very little in common with a contemporary transgender or intersex individual, who is (in addition to being only one person) not always interested in being both male and female. It may be more correct to connect the various myths to specific terms such as “gender fluid” or – in the case of Ardhanarishvara – perhaps “bigender”, or to not attempt to translate them into anything contemporary or even human at all.