The Beatles did indeed reference gender nonconformity and play with gender roles in their lyrics, as you've pointed out in the songs "Ob-La-Di, Ob-La-Da" and "Get Back." These songs, especially for their time, touched on themes that were not commonly addressed in popular music.
Other artists from the 1960s and 1970s also explored themes of gender nonconformity and transgender identity, although these references were often subtle or coded due to societal norms and potential backlash. Here are some songs from that period that addressed these themes:
-
David Bowie - Throughout his career, Bowie played with gender norms and identity. In the early 1970s, his androgynous alter ego Ziggy Stardust became a queer icon. His song "Rebel Rebel" from the 1974 album "Diamond Dogs" is a celebration of gender rebellion with the lyrics, "You've got your mother in a whirl / She's not sure if you're a boy or a girl."
-
The Kinks - "Lola" from their 1970 album "Lola Versus Powerman and the Moneygoround, Part One" is about a romantic encounter between a young man and a woman who is implied to be a transgender person (the line "Well, I'm not the world's most masculine man / But I know what I am and I'm glad I'm a man / And so is Lola" suggests this).
-
Lou Reed - "Walk on the Wild Side" from the 1972 album "Transformer" is a song that describes individuals, including transgender women, who were part of Andy Warhol's Factory scene. The lyrics mention Holly Woodlawn and Candy Darling, both of whom were transgender.
-
Jobriath - An openly gay American musician who often incorporated themes of gender fluidity and was known for his glam rock persona in the early 1970s.
-
Jayne County - A transgender performer and lead singer of Wayne County & the Electric Chairs, Jayne County was a prominent figure in the punk rock scene and openly explored transgender themes in her music.
-
Peter Allen - "Tenterfield Saddler" from the 1972 eponymous album contains a line that refers to Allen's grandfather who had "a son who grew up, and just had to go, who learnt it was better to just say no." While this line is not explicitly about gender or transgender issues, it subtly touches upon Allen's own struggles with his sexual identity.
During the 60s and 70s, discussing gender nonconformity and transgender issues in a public forum like a popular song was often taboo, and artists had to be more oblique in their references. Nonetheless, these examples show that such themes were indeed present in the music of the era, contributing to the gradual evolution of societal attitudes towards gender and identity.