What is the title of the book within Star Wars Legends that contains the story about how Boba Fett escapes the Sarlacc pit?
Boba Fett was established as having survived The Battle of the Great Pit of Carkoon in The Dark Empire comics, but how he survived is left rather vague, simply saying
This was initially published in Dark Empire issue 5, released in August, 1992.
There are a few stories that deal with the actual story of his survival and escape.
The first, and most detailed is A Barve Like That: The Tale of Boba Fett, which was published as one of the stories in Tales from Jabba's Palace, published in January 1996. This is the story that focuses on the escape itself.
It is summarized on Wookieepedia as:
It details Dengar finding Boba Fett having just survived his escape from Sarlacc. This story deals mostly with Dengar nursing Fett back to health, and only relates a little information of the escape itself.
The trilogy is summarized as
The scenes regarding Fett's survival and escape are from the early portions of the The Mandalorian Armor book, and is an expanded retelling of the A Barve Like That story meshed with the Payback: The Tale of Dengar story, mostly as a setup for the rest of the books. If you've read the previous two stories by this point, you've already gotten most of the pertinent information.
His survival also appears in the marvel starwars comic, i want to say issue 81 or 82, that came out just after Jedi. The sarlaac spit him out, and if I remember correctly at the end of the story he's in one of the Jawa Sand Crawlers that go back in, but I would assume that if it couldn't digest him, it couldn't digest an entire ship either.
I remember reading that he used explosives and that the juices from the Sarlacc ate through his armor and disfigured him if you go by the Dark Horse Comics and the Bounty Hunter Wars