Guess 1: There was a phonology book in the cabin. Not even a hypergenius could actually learn a spoken language that way, but with enough detail about physiology, it would probably be possible to figure out how to spell a simple word. (For which, of course, there was no wrong spelling. Maybe he pronounced it more like Durson, but once he spelled it Tarzan, that was how it was spelled. Heck, he was an English aristocrat, maybe he pronounced it Throat-Warbler Mangrove or Chumley.)
Guess 2: Perhaps he used something other than a sound-spelling of his name, but Burroughs eliminated this point for the sake of the story. He might have used a glyph or a scrawl, especially if he had read accounts of sailors and illiterates using a “mark” as a signature. Clayton et al. would have only learned the pronunciation later. This would have complicated the story and dragged it down, so Burroughs simply had him write his name without explanation.
Or he might have used other words or letters to describe himself. Maybe he combined the letters of appropriate words in a pleasing-to-him arrangement, or translated the meaning of his name into English. The latter could have been Whitey or White (a good English surname) of the Apes, since Tarzan meant “white skin.” This might plausibly have identified his lordship in other accounts, and confused the reader, so again Burroughs would likely have substituted the name he used for his account. Besides, “Whitey of the Apes” or (in the former of the cases mentioned) “Mape of the Apes” would have been unlikely to have produced the effect desired upon the reader.
Guess 3: The passage in which Tarzan first kills an African and contemplates eating him has every sign of being an interpolation designed to reassure the reader of Tarzan’s human morality. The story gives every plausible reason why Tarzan would have naturally eaten the man he killed, but implausibly and rather transparently claims that he didn’t, and so “hereditary instinct . . . saved him from transgressing a worldwide law of whose very existence he was ignorant.” Obviously, Tarzan did, in fact, eat his victim, and this overwrought defense was merely a cover to give comfort to the reader and make the tale acceptable to society - and perhaps the publisher.
Given this, it seems likely that other concessions to decency would also have been made, and we may assume the letters, in which he wrote his name, are another. These almost entirely concern his initial encounter and communication with Clayton and the rest of the party, especially Jane. These points, too, are particularly implausible to anyone acquainted with the ways of brute animals, which Tarzan would be most likely to follow without question. Undoubtedly upon spying for the first time members of his own people, and particularly a group of men accompanying a female he found attractive, he would immediately have captured them in the cabin and buggered them raw, male and female, singularly and at once. Naturally, they would all have agreed - especially after he became their friend and romantically engaged with Miss Porter - never to speak of this again, and so some other explanation for their learning of his presence and identity had to be invented. The story of the notice and the letters was therefore a polite fiction in an otherwise unwavering tale.