Anyway that's probably getting a bit off topic. I think Cheery Littlebottom (a Dwarf in the Guards series) maps much better to being a metaphor on transness.
But Pratchett was taking on issues of gender and sexism as early as Equal Rites and had women leads in Strata, both from the 80s.