There’s a haunted house in every book I write, if you look hard enough,” Jenny Boylan says. Her latest book, Long Black Veil (Crown, April), is a tale of murder and disappearance with a hero troubled by an unprecedented sort of phantom. It’s her first novel in two decades—and her first thriller.

Reclining on a sofa at her upper Manhattan apartment, Boylan counts off titles: “In The Planets, which I wrote under a male byline, there’s an abandoned high school. In She’s Not There—in all my memoirs—there’s my mother’s house. Long Black Veil has a vacated prison where a group of young people accidentally get locked in. And then find out they’re not alone.”

Does Boylan expect to continue with the spooky real estate? “You know, I think I keep looping back to that,” she says, sounding mildly mystified by her own device. She laughs. “Either that, or time to beat this one to death. What do you think?”

And then there’s the music. In Boylan’s apartment, a framed poster for Die Zauberflöte hangs next to a 1906 Steinway parlor grand piano. Her three memoirs, she reminds me, were named for pop tunes, as is Long Black Veil. She credits the friend who read an early draft and compared it to the creepy and beloved country ballad. Although Boylan hadn’t seen the connection (which isn’t obvious until halfway into the story), she knew she’d found the perfect title.

Switching to a new genre counts as brave even (and especially) when an author is as successful and beloved as Boylan is. When asked if she’s nervous, she tells a story. When she was transitioning in the early 2000s, someone suggested it might be easier on her family if she moved to Boston: “Some big city like that, where I’d be surrounded by other transgender people. As if the only people who could understand me... What was that Hawaii island where they had the leper colony—Molokai? Yeah, Molokai. It was like, ‘Move off to Molokai where all the other transgender people live, and maybe there will be a saintly priest who’ll live among you.’”

Boylan stayed put in Maine (where she was a popular faculty member at Colby College), though she did briefly consider changing professions. “I thought, wait, I’m going to go from teaching, which I know I do well, to something I might do terribly simply because I want a clean slate?”

As things turned out, the most significant difference for Boylan in transitioning was going from someone who had a secret to someone who didn’t. “When I realized I could be myself, that was a great relief,” she says. “I mean, so many things haven’t changed. I have the same sense of humor, I’ve read the same books, love the same people, have the same friends. And, you know, I hear it most vividly in my voice. My speaking voice is not the voice I spoke in as a guy. Nor is it the excessively feminine voice that I developed in consultation with a voice therapist early on. My voice has fallen into a kind of androgynous place—I often get called sir on the telephone, which is of course infuriating for me.”

Boylan says that she didn’t sing for five years, “because I would out myself.” She adds: “And then one day when I was at the piano, I literally said to myself, ‘Let’s get this straight: after everything you’ve been through—like, you know, talking about your genitalia on the Oprah Winfrey Show—you’re not gonna sing?’ So I’m not Julie Andrews—I mean I’m not James Earl Jones either. But, it’s all cool. And whether some parts of me are still masculine, and some parts are überfeminine, who am I trying to win over at this point?” She laughs. “Maybe readers.”

Boylan thinks that her writing as a woman is “a little more aware of the trouble in the world.” She adds: “Those earlier books I wrote when I was male, or whatever you want to call it, in my 20s and 30s are fueled by a kind of manic, comic spirit. They’re buoyantly, joyfully goofy. Rereading them I think you would have the sense of an entertaining writer who was hiding something, using humor as a way of running from the truth. The experiences I’ve gone through... Well, you can’t reach the age of 58 without having a few arrows sticking out of your side. And I’m one of the luckiest, happiest transgender people in the universe. Virtually everything that could have gone wrong didn’t for me. But nobody embarks on this journey without tears somewhere along the line. And where I used to just try to rise above all the trouble in the world on a giant wave of blarney, and still think I’m full of beans, I’m more aware of the price we all pay for telling the truth. There’s a line in the book where someone says, ‘You know, if telling the truth were so easy I bet it would be more popular.’ ”

Boylan has come back to fiction with an evolved perspective. “I tried to write murder stories before, but my villains always seemed two-dimensional because, well, they were evil,” she says. “I’d write a character like... I don’t want to say Hannibal Lecter, because he’s a great character, but a character who was defined by lacking a moral compass and doing bad things. And it never seemed convincing to me. Because, I finally realized, no one’s a villain to themselves.”

So Boylan set out to write a story in which terrible things are not the result of evil run amok but of accidents, or bad choices that got out of hand. “Everybody has some sort of explanation for why they’ve done the terrible things they’ve done,” she says. “The people who’re responsible for the seriously dark bad stuff that happens in the book are, at least to themselves, justifiable and good people. And, like our transgender character, most are also involved in the difficult quest to become themselves. I suppose it’s inevitable to reveal there’s a transgender character in Long Black Veil, although we don’t know who at first.” Careful not to let too many cats out of the bag, she adds, “It’s not the great mystery of the book, but it’s an initial mystery.”

Boylan explains that by the time she decided to have gender reassignment surgery in 2001, the protocol her character undergoes, known as stealth (in which one cuts off all connection with people from one’s former life), was becoming less popular. “Believe it or not, it used to be the way trans people were counseled to go through the business,” she says. “Essentially it forces you to trade one secret for another. It’s important to know—I need to emphasize this—that the trans people who do this are not trying to trick people. They’re just trying to survive in the world.”

These days Boylan, along with her wife, Deedie, shuttles between New York City and Belgrade Lakes, Maine, where the couple raised their two sons. When not coaching her Barnard students via Twitter (“Tonight I told them: ‘Stop exercising. Use that extra 90 minutes a day to write. You will gain 10 pounds. And write a novel. Worth it.’ ”) and working on the next novel, she tirelessly lobbies for GLAAD, though she’s in her valedictory term as the board’s first openly transgender cochair.

Connecting Boylan’s and others’ transgender experiences to those of people outside that community remains a primary goal in Boylan’s writing and in her activism. “I want people to know that people like me are capable of all sorts of things, in addition to being able to put on lipstick,” she says. “Part of what generates so much of the animosity toward our community—right now we’re experiencing a whole raft of legislation aimed at making us less visible—is that trans experience seems unimaginable; that the kinds of things that motivate us, that obsess us, are unknowable to straight people. Well, I’m trying to enable a reader who hasn’t gone through this to nonetheless say, well, that feeling or that question is universal. So there’s a lot of me in the trans character in Long Black Veil, but other people’s truths get revealed too.”

And the great mystery of Long Black Veil? “Let’s just say it’s tied to keeping secrets,” Boylan says. “And the tension we all bear between what cannot be spoken and what must be told.”

Laura Mathews is a freelance writer in New York City.