I've read somewhere that Hipparchus measured the distance to the Moon using the lunar and solar eclipse and obtained a value of around 67.3 Earth radii. It also says that soon after Ptolemy gave a more accurate value of 59.7 Earth radii, but I want to know how did he arrive at this?
Ptolemy knew about the Moon's parallax (he explains it in section 11, Ch. V of Mathematical Syntaxis). To measure it he invented the "parallactic instrument" described in section 12. Section 13 is dedicated to determination of Moon's distance, where he explains his observation in great detail.
Roughly speaking he computes the Moon's geocentric position in the sky from theory (which was very accurate for this purpose), and compares it with an observation. He finds a parallax of 1.7 degrees. (Of course he makes the necessary precaution that the theory describing the true motion of the Moon is independent of the parallax. It describes the Moon's position as seen from the center of the Earth.)
The parallax gives the distance in units of the Earth's radius: he finds this distance to be approximately 39 (at the time of observation). The average distance according to Ptolemy is 59. This is a good result for the accuracy of observations at that time. He does not discuss the Earth radius in other units, like stadii, probably he did not care much. He also discusses the parallax of the Sun, but here he is wrong by far: the Sun's parallax is too small to be reliably measured in Ptolemy's time.
The existence of the Moon's parallax was already known to Hipparchus, but none of the technical writings of Hipparchus survives, so all our information is based on Ptolemy's Syntaxis ("Almagest").
Remark: There are easily available translations of Ptolemy, but is a difficult reading. For the general idea, type various combinations of the words "Ptolemy" "parallax", "parallactic instrument" and "triquetrum (astronomy)" on Google.
On Sizes and Distances, describes the method of Hipparchus, with modern reconstructions. As stated in the article, Ptolemy gives these results in Almagest V, 11. Ptolemy provides his own, improved estimate, and his procedure, in section 13.
There is a nice discussion in this article on Lunar Parallax.