When, by whom and in which paper where moments of a random variable used first in probability theory?
Moment was taken into Statistics from Mechanics by Karl Pearson when he treated the frequency-curve (or observation curve) as the sheet enclosed by the curve and the horizontal axis. See his "Asymmetrical Frequency Curves," Nature October 26th 1893: "Now the centre of gravity of the observation curve is found at once, also its area and its first four moments by easy calculation." [OED].
The phrase method of moments was used in a statistics sense in the first of Karl Pearson’s "Contributions to the Mathematical Theory of Evolution," (Philosophical Transactions of the Royal Society A, 185, (1894), p. 75.). Pearson used the method to estimate the parameters of a mixture of normal distributions. For several years Pearson used the method on different problems but the name only gained general currency with the publication of his 1902 Biometrika paper "On the systematic fitting of curves to observations and measurements" (David 1995). In "On the Mathematical Foundations of Theoretical Statistics" (Phil. Trans. R. Soc. 1922), Fisher criticized the method for being inefficient compared to his own maximum likelihood method (Hald pp. 650 and 719).
Moment generating function. R. A. Fisher seems to have brought this term into English in his "Moments and Product Moments of Sampling Distributions.," Proceedings of the London Mathematical Society, Series 2, 30, (1929), p. 238. He probably took the term from V. Romanovsky "Sur Certaines Éspérances Mathématiques et sur l'Erreur Moyenenne du Coefficient de Corrélation, Comptes Rendus, 180, (1925), 1897-1899. Romanovsky refers to "la function génératrice des moments" (p. 1898).