“Identifying as a third gender” is in itself an idea from the last two decades. In the 90s and all of previous history, nobody thought hijra were a “third gender” (least of all in their own culture), because that wasn’t an available cultural idea. They were understood as male prostitutes of the lower castes, whose customers were other men, and who lived lives in marginalised communities, and dressed as women to signal their social status and work (both as gay men, but also as a form of entertainment — they made a living by dancing/begging/extorting money to avoid curses, as well as prostitution).
This often involved the idea of what used to be called hermaphroditism, partly because of its links to the idea of the divine feminine (and hijra were primarily of a Hindu cultural context where caste and religion are inextricably linked to the idea of the hijra), and partly because some hijra were disabled or intersex. It was also an escape from marriage and sometimes even less palatable social ostracism for men of the lowest castes (hijra communities were considered outside the lowest castes, who were themselves marginalised — but they had a social function and way of making money to survive). There was a significant overlap between disability, especially disorders of sexual development, caste status, and sexuality. This might have been socially legitimated partly by religious beliefs about the feminine, and ideas about men who were also spiritually “women” because they had sex with men; but that’s not remotely the same as the idea of “gender”.
The idea of a “third gender”, in the sense that Anglophones think of it today, is something completely different. Confusing the two is like seeing pantomime dames in early twentieth century music hall and thinking that’s evidence of a “third gender”. Or saying that camp gay men are “feminine”, therefore they are a “third gender”.
Neither was “two spirit” understood as a “third gender” before gender ideology. These were primarily ways of people living same-sex attracted lives in social and religious systems very alien to us. They were not “identifies” or “genders” in the sense that gender ideology (primarily of the last couple of decades) thinks of “identities” at all. These Western postwar idea of “Identity” as a concept is profoundly alien to most of our historical forebears, and large parts of the rest of the world, especially those with strong religious cultures.
Thinking that other cultures can be understood in very Western, modern terms like “identifying” and “gender” is a deeply colonising manoeuvre in itself. Gender ideology is profoundly Orientalist, always trying to make other cultures into some kind of mirror for ideas of “gender” that have only popped up very recently, and make little sense outside a Western linguistic, cultural and political framework.