We sketch of Gallagher's proof modulo a few details left as exercises. Throughout, keep \(k\) fixed.
Put
\begin{align*}
a(p, m) \amp= \left(1 - \frac{m}{p} \right) \left( 1 - \frac{1}{p} \right)^{-k} - 1\\
a_{\calH}(p) \amp= a(p, v_{\calH}(p))
\end{align*}
so that
\begin{equation*}
\frakS(\calH) = \prod_p (1 + a_{\calH}(p)).
\end{equation*}
Extend \(a\) by multiplicativity to squarefree arguments \(d\text{,}\) so that
\begin{equation*}
\frakS(\calH) = \sum_d a_{\calH}(d)
\end{equation*}
with the sum on the right being absolutely convergent.
We can truncate the sum over
\(d\) because for fixed
\(\epsilon > 0\text{,}\) we have (by
Exercise 20.3.3) that
\begin{equation}
\sum_{\calH \in \{1, \dots,x\}^k}
\frakS(\calH) = \sum_{d \leq y} \sum_{\calH} a_\calH(d)
+ O(x^k (xy)^\epsilon/y)\tag{20.2.1}
\end{equation}
with the constant depending only on \(k,\epsilon\) and not on \(x,y\text{.}\)
For any given
\(d\text{,}\) we can rewrite the inner sum of
(20.2.1) as a sum
\begin{equation*}
\sum_v \left(\prod_{p|d} a(p,v(p)) \right)f_d(x,v),
\end{equation*}
where \(v\) runs over vectors indexed by the prime factors of \(d\text{,}\) with \(v(p) \in \{1, \dots, p\}\) for each \(p | d\text{,}\) and \(f_d(x,v)\) counts \(k\)-tuples \(\calH \in \{1,\dots,x\}^r\) which occupy exactly \(v(p)\) residue classes modulo \(p\) for each \(p | d\text{.}\)
Write \(\stir{a}{b}\) for the number of partitions of an \(a\)-element set into \(b\) unordered parts (Stirling number of the second kind). If we set
\begin{align*}
A(d) \amp= \sum_v \prod_{p|d} a(p,v(p)) \binom{p}{v(p)} v(p)! \stir{k}{v(p)}\\
B(d) \amp= \sum_v \prod_{p|d} |a(p,v(p))| \binom{p}{v(p)} v(p)! \stir{k}{v(p)}\\
C(d) \amp= \sum_v \prod_{p|d} |a(p,v(p))|,
\end{align*}
then
\begin{equation}
\sum_{\calH} a_\calH(d) = (x/d)^k A(d) + O((x/d)^{k-1} B(d)) + O(x^{k-1} C(d)).\tag{20.2.2}
\end{equation}
From this, plus the identities
\begin{align}
\sum_{v=1}^p \binom{p}{v} v! \stir{k}{v} \amp= p^k\tag{20.2.3}\\
\sum_{v=1}^p v \binom{p}{v} v! \stir{k}{v} \amp= p^{k+1} - (p-1)^k p\tag{20.2.4}
\end{align}