I've written a lot on this topic, including a book which I will not plug.
First, transgender people have existed since before Abraham and Sarah went to Egypt. Actually, there is written history of transgender people as far back as 10,000 years in India. But first a bit of terminology. Transgender is a term that was coined in 1985 to describe anyone whose gender identity does not match the identity they were assigned at birth. Gender Confirmation Surgery, previously known as Sex Change Surgery didn't exist until around 1920.
Up until the 1890s, members of the "third sex" had themselves castrated before puberty. Even today, in parts of India, Pakistan, and Persia, this is still a common practice. They often run away from home to join the Hjira or Manuthun(sic) or the Hebrew Siris. Pretty much since the domestication of livestock, when herders realized that there was less fighting and better eating by castrating all but the best male sheep, goats, or cattle which made the males act more like females and they could be tender meat as food. So when boys wanted to stay with the women, and acted like women, they were often given the choice of going with their fathers, or having themselves castrated. Furthermore, there was even a version of HRT for these castrated children. The urine of pregnant livestock could be collected, evaporated, and mixed with wine which provided a concentrated form of estrogen. Even today pregnant mare urine is packaged under the trade name Premarin.
The first non-Jewish Christian was a eunuch or Siris on a diplomatic mission for the queen of Ethiopia. Third gender eunuchs were often used as messengers and diplomats because they could travel unnoticed as women until they arrived, or could travel in men's clothes when there might be thieves or robbers in the area. The distinguishing characteristic of these wise Eunuchs was that they had the soft feminine voice of a woman, yet small or nonexistent breasts.
These people were very intelligent and Siris were considered extremely wise. In other cultures, they were considered consecrated virgins and served as Oracles, Seers, Prophets, and Wise Men. It's possible that some of the prophets such as Daniel (Lion's Den), Shadrak, Mishak, and Abednego (Furnace) may have been third gender Eunuchs castrated before puberty by their own choice.
In Mathew 12:19 Jesus talks about those made Eunuchs (such as an accident), those born Eunuchs (a much more common birth defect since it wasn't corrected at birth), and those who had themselves made eunuchs. These third gender Eunuchs believed that God made them this way and that it was their destiny to be castrated, which is why they would ask to be castrated before puberty.
A common verse is Deuteronomy where the KJV says a woman should not wear men's clothes, and a man should not wear women's clothes. In the culture of the time the book was written, men and women usually wore the same clothes, a shirt that came to the ankles, a robe or cloak, and a head scarf worn around the head for protection from the sun and the heat. The original Aramaic and Hebrew versions allude more specifically to the Armor worn by soldiers. In effect, the command was that you shouldn't dress women as warriors unless they have been trained to fight, and you shouldn't try to hide armor under cloaks and head scarves. This makes sense if you think about it. If the town is being invaded and there are a bunch of untrained women dressed in armor to make their forces seem larger, then the invaders would kill all the women as well as the men. Conversely, if the invaders couldn't tell the difference between cloaked warriors and unarmed civilians, the invaders would just have to kill everyone. The problem with either scenario is that even if the invaders are repelled, so many women would have been killed that the town would be unable to rebuild it's population and the town, or all of Israel would have been destroyed.
As for the verse in Leviticus 18, the KJV says "A man should not lie with a man as with a woman". In the original Hebrew, it's more like a man cannot be forced to become a concubine. Keep in mind that in the time that the verse was written, all marriages were arranged by the parents, often before the children were born, in exchange for things of real value such as land, grazing rights, use of wells, or even for livestock. But what if both parties only had sons? In other cultures of the time, the creditor could demand that the youngest boy be castrated and given as a concubine to the oldest son. The young son had no say in the matter. In effect, the son was being forcibly castrated so he could be raped by the son. So the homosexual activity was not between two consenting partners, but by a father being forced to pay a debt.
The other passage is in Deuteronomy in which the verse says that men who lay with each other were to be stoned to death. Again, in the original culture and language, the act being referenced here was rape. Furthermore, if a man raped a woman, both the rapist and the woman were to be stoned to death. In fact, the only way to avoid the stoning was if the couple was out in the country and there was nobody to hear the woman's calls for help, and the "rapist" had to pay a "bride price" and marry the woman as a wife, otherwise both were to be put to death. Again, the key was that the marriage were to be arranged by the parents, and the parents had the responsibility to kill the amorous couple for messing up a previously arranged marriage.
Keep in mind that there are at least 3 layers of propaganda campaigns between the Aramaic translations used by priests prior to the Babylonian captivity and the King James bible. The Babylonian captivity was when the exiled Hebrews started copying the Torah in Hebrew, each boy copying several pages during puberty as they prepared for coming of age and preparing for marriage. Then there were two different translations to Greek, the most commonly used being the Septiguint, supposedly 70 priests translated the same verses the same way to show that there was no threat to the Greek kings.
The translation to Latin was from the Greek, and there was little reference back to the original Hebrew, partly because after the destruction of Herod's Temple, the Jews were pretty much considered criminals. The books and translations approved for the new officially recognized Christian church had to please Constantine and the priests knew it.
The translation from Latin to English was actually very controversial. The original Tilsdale translation almost got him hanged, drawn, and quartered by Queen Elizabeth because the translators weren't exactly thrilled to be ruled by a queen. The original translations were also controversial because they followed the patterns used by the Protestants in Germany and Holland rather than an authentically English translation. There were Catholic, Protestant, and Church of England translations and all were less than generous toward women. When King James finally commissioned the translation to be approved by him, the poets had pretty much taken over, and much of the original Latin context was lost.
It's ironic that Jews had adopted the practice of teaching all of their children to read and write Hebrew and continued to do so for centuries, while most English people during the time of King James couldn't read even basic English signs.
Anyone who has done any real scholarship in the four languages understands how difficult it is to create an accurate translation, and the biggest myth is the claim of a "Word for Word" translation, since there are numerous words in Hebrew that require a paragraph to translate accurately, and Hebrew may have 12 words that have very different contextual meanings yet get translated to the same words in English with no concept of the context.
Many fundamentalists and religious fanatics have tried to persecute the Jews because they know that nearly everything in their vernacular translation can easily be corrected by even boys who have barely started to shave. We can start with the seven day creation. The Hebrew version is actually closer to the billion years described by modern scientists, complete with asteroids and comets. Of course, the irony is that many of these concepts weren't clearly understood by scientists until the latter half of the 20th century.