Solution (source code)

= Solution

Condition on the count and use the <independence of random variables> of the claim sizes. For $n\ge1$ their joint exponential transform factors, while for $n=0$ the empty sum contributes $1$. Consequently the <law of total expectation> gives
$$
\begin{aligned}
M_S(r)&=\sum_{n=0}^{\infty}\mathbb P(N=n)\,
\mathbb E\left[\exp\left(r\sum_{i=1}^{n}X_i\right)\right]\\
&=\sum_{n=0}^{\infty}\mathbb P(N=n)M_X(r)^n
=\boxed{G_N(M_X(r)).}
\end{aligned}
$$
This <random sum of independent claims> transform uses both independence assumptions: the count must be independent of the entire claim-size sequence, and the sizes must be mutually independent with the same <probability distribution>. The <probability generating function> is interpreted through its defining nonnegative series. The identity holds as a finite <moment-generating function> wherever that series is finite; outside that domain the expectation and series can agree at $+\infty$. In particular a positive argument may take $M_X(r)$ beyond $1$, so finiteness does not follow merely from the usual unit-disk domain of a <probability generating function>.