For the observing hijab in front of transgender people question...
It depends...
Practical considerations
Ordinarily, if a woman follows the ruling about wearing hijab in front of non-mahram men, she'll wear it almost continuously outside the home. So, even in the rare case she meets a non-mahram transgender person, she's probably already wearing hijab.
Exceptions arise for things like female bathrooms, ablution rooms (wudu), female-only events, where women might not observe hijab. If she's up tight about things, she could just wait until the transgender person is no longer around.
Some transgender women are "passable" (i.e., you can't readily tell them apart from natal women). Also, identifying pre-transition transgender men would be impossible. Presumably this falls under: "The reward of deeds depends upon the intentions..." (Sahih al-Bukhari 1), i.e., a woman wouldn't be blamed for not observing veil in front of someone she believes is a woman.
It's very rare that this would be a concern in practice. Realistically, a woman would likely make a best guess at the time.
School of thought
Some schools of thought are accepting of transgender people. Shia Islam in Iran is one notable example; see Transsexuality in Iran. A transgender woman will (eventually) be accepted as a woman, so other women will not be required to observe hijab in her presence.
Malaysia (Shafi'i fiqh, Sunni Islam) is at the other extreme, where transgender peoples' gender identities have been known to be rejected. See LGBT rights in Malaysia. If a woman is following these rulings, she would observe hijab in front of transgender women, and probably in front of all transgender people out of caution.
(Also practically, you're less likely to meet observably transgender people in places like Malaysia, where this ruling would apply.)
And finally, what about post-surgery trans-persons (i.e. after surgically changing their physiological features and genitalia)?
Women don't ordinarily interact with other people's genitals, so I'm not sure what the question is here.
Note: I don't know the attitude of islam towards its members being trans (that would be a different question), but given that muslim individuals may interact with non-muslims they may still encounter trans-people.
There's transgender Muslims around; likely the same proportion of the population as in the West.
The Qur'an
Qur'an 24:31 includes an exception for covering in front of males with no physical desire:
And tell the believing women to reduce [some] of their vision and guard their private parts and not expose their adornment except that which [necessarily] appears thereof and to wrap [a portion of] their headcovers over their chests and not expose their adornment except to their husbands, their fathers, their husbands' fathers, their sons, their husbands' sons, their brothers, their brothers' sons, their sisters' sons, their women, that which their right hands possess, or those male attendants having no physical desire, or children who are not yet aware of the private aspects of women. And let them not stamp their feet to make known what they conceal of their adornment. And turn to Allah in repentance, all of you, O believers, that you might succeed.
Haneef (2011) (pdf) wrote that this may be applicable in the case of transgender women:
Ghayr uli al-irbah, according to some erudite exegetes were those effeminate men with no feelings of desire towards women.
giving the references: Muhammad ibn Ahmad al-Qurtubi, al-Jami'li Ahkam al-Qur'an (Beirut: Ihya al-Turath al-Arabi, n.d), 12, 234; Muhammad ibn Jarir al-Tabari, Jami' al-Bayan fi Tafsir al-Qur'an (Bierut: Dar al-Fikr al-Ma'rifah, n.d), 19, 163; Isma'il Abi Fida Ibn Kathir , Tafsir al-Qur'an al-Azim (Riy ad: Maktabat al-Riyad al-Hadithah, n.d), 6, 48.