In December 1904, a 56-year-old man called Thomas E Boulton died in the National Hospital in London’s Queen Square. In April 1870, a 22-year-old named Stella Clinton was arrested on the pavement outside the Royal Strand theatre, having just used the ladies’ lavatory in that building, and was charged with conspiracy to commit a felony. Between those two dates, a female impersonator who called himself both Ernest Byne and Ernest Blair appeared in theatres and music halls from New York to the Isle of Man, receiving applause as an actor one week, an actress the next.

All of these very different people occupied the same body. We think of gender fluidity – not to mention high anxiety about the correct use of public toilets, especially if you live in North Carolina – as a very modern topic. But the police records, play scripts, song lyrics and photographs that Ernest Boulton, AKA Stella, left behind are a fascinating reminder that people had the nerve to treat gender as an experiment long before Caitlyn Jenner and Andrej Pejić made the news.

Facebook Twitter Pinterest Thomas E Boulton, AKA Stella, in the 19th century. Photograph: © Fred Spalding/courtesy Essex Record Office

Boulton was a remarkable creature on two counts. First, he got away with it – and in style, something men like him weren’t meant to do in the homophobic London of Oscar Wilde. Despite the fact that everything about his alter ego Stella and her low-cut gowns screamed “guilty”, his lawyer managed to get Boulton off when he stood trial at the Old Bailey following that 1870 arrest. Then, instead of retiring to obscurity, he (or she) immediately resumed a career on stage, with hair dyed bright blond, repudiating the very idea of guilt with a shameless and highly public parade of effeminate beauty. Second, Boulton’s life not only challenged Victorian values, it also challenges our own contemporary ideas about the fixity of gender. Even when someone chooses to transition or transform from one gender to another, we see gender as a destination, not as a journey.

Like Stella, I know how dangerous it can be to transgress the perceived rules of your given gender

Boulton, on the other hand, created and inhabited identities as he needed them. His transformations were all provisional. For his appearance in the dock at the Old Bailey, he grew a moustache, and passed as the diametrically different character the police were trying to pin on him, swapping the body of a knowing queer sex worker for that of a nice-but-dim straight boy from the suburbs. On tour, he switched between working as a glamorous drag queen playing opposite a male lover and working with his brother in a respected double act. He must have taken his one-way journey to the National Hospital dressed as a man, inhabiting a final identity no less hard-won than any of the others.

Boulton’s story refracts my own. Although I have never passed in my life – or wanted to – I have frocked up in my time, and know the liberating thrill of dressing and undressing on my own terms. I also know how dangerous it can be to transgress the perceived rules of your given gender. One night in 1986, as I was making my way to the Hippodrome across Leicester Square, a good-looking young man in his early 30s blocked my path and asked me if I could guess what he was thinking of doing to me later. Since I was wearing a rather fetching little black backless number and 20-denier back-seamed stockings, I took the liberty of asking him to elaborate further. He leaned forward and told me in no uncertain terms exactly how he’d like to kill me. Fortunately, he was drunk – and I knew how to move fast in three-inch heels.

Facebook Twitter Pinterest Identity politics … Oscar Batterham and Richard Cant in Neil Bartlett’s new work Stella. Photograph: Matthew Hargraves

I’m now a year older than Boulton was when he died, and find myself facing my own questions about how best to embody myself in a changing society. I moved house 18 months ago, and a chance rearrangement of some papers brought my diary entry for that night in 1986 into collision with some photocopies of Stella’s old playbills. It drove me to my desk, and eventually to approach some colleagues with an idea for a theatre piece that would bring Stella back to life and let her talk to the audience about what she – and I – went through.

What does it mean to be old enough to remember the bad old days, but still young enough to want much more change from the world? What does it mean to feel that rules are only there for breaking? As I head into rehearsals looking back at Thomas E Boulton’s scandalous and ever-changing life – and at his subtly beautiful face – reminds me that the real question is not what category you fit into, but how brave you are.