Transgender is an umbrella term which encompasses many forms of sex and gender variance. Note that this term is different from transexual, which refers to people who wish to become members of the opposite gender and may undergo hormones or surgery to do so. Sexual Orientation vs. Sexual Identity - Sexual orientation involves the gender to which people are attracted. Sexual identity refers to what gender people find themselves to be. In our society, these concepts are often lumped together.
Sex correlates to the biological organs, hormones, etc. which are parts of the body.
In our society, there are two genders, but this is not true for all cultures around the world. Some cultures distinguish five genders. Many Native American tribes recognize three genders. The Hira of India are not considered either male or female. Gender and sex may not be as closely correlated as Western culture tends to believe.