How can I derive a moment generating function from a PDF or CDF?

How can I derive a moment generating function from a PDF or CDF?

For example if I have the following pdf:

1- Nakagami:

(m^m*x^(m - 1)*Gamma[m, x/\[Gamma]1])/(\[Gamma]^m*Gamma[m]^2)*Exp[-x*m/\[Gamma]]

2- Rayleigh:

1/b * exp(-(x/b))

There is a MomentGeneratingFunction in Mathematica:

[MomentGeneratingFunction—Wolfram Documentation

](MomentGeneratingFunction—Wolfram Documentation)