Sex refers to the aspects of a person's biology which are sexually dimorphic. This includes chromosomes, hormone levels, genitalia, and secondary sex characteristics such as breast size, hip to waist ratio, body hair and voice pitch. These characteristics are officially viewed as being the persons gender, however, according to the LGBTQ community sex and gender are separate concepts.
Although each person's sex characteristics are slightly different, sex is often grouped broadly into two categories: male and female, referred to as binary or dyadic sexes. Sex is typically assigned at birth based on the physiology, and may not reflect how they prefer to be characterised as later in life. People whose sex cannot be categorised clearly as male or female are referred to as intersex and horrifyingly, many are given "corrective" surgery without their consent so that their biology more closely matches to male or female.
Unlike the LGBTQ accepted gender expression, sex characteristics can typically only be consciously altered through medical treatment, such as surgery or hormone replacement therapy. Transgender people often undergo such treatments as part of their transition. Cisgender people may also alter their sex characteristics through medical treatments, such as by taking hormonal birth control or a mastectomy (breast removal) to treat breast cancer. Sex characteristics which do not align with gender identity are often a focus of bodily dysphoria.
Referring to transgender people via their sex is typically seen as disrespectful, as people prefer to be called by their self-assigned gender. In cases where self-assigned gender is considered irrelevant, such as a medical setting, it is sometimes more important to consider their individual biology and history than which broad categorisation they fall under.