The different generators of canonical transformations Consider the phase space of a one degree of freedom mechanical system. We can pass from one phase space coordinates to another phase space coordinates via a canonical transformation. I want to focus on 1-parameter canonical transformations,
$$(q_{0},p_{0})\rightarrow(q_{\lambda},p_{\lambda})$$
where $\lambda\in[0,\infty)$ parametrize the transformation.
By the standard theory, there exist a function $F=F_{1}(q_{0},q_{\lambda};\lambda)$ such that
$$p_{0}\frac{dq_{0}}{dt}-H=p_{\lambda}\frac{dq_{\lambda}}{dt}-K+\frac{dF_{1}}{dt}.$$
$F$ is called the generator of the transformation, and the following equation follows
$$p_{0}    =\frac{\partial F_{1}}{\partial q_{0}},\qquad p_{\lambda}=-\frac{\partial F_{1}}{\partial q_{\lambda}},\qquad K=H+\frac{\partial F_{1}}{\partial t}.$$
Now, also by standard theory, there exists a function  $W=W(q,p;\lambda)$ such that the transformation can be obtained via the Poisson brackets using the equations
$$\frac{dq}{d\lambda}    =\left\{ q,W\right\}, $$
$$\frac{dp}{d\lambda}    =\left\{ p,W\right\}.$$
$W$ is again sometimes called the generator of the transformation.
What is the relation between $F$ and $W $?
 A: That's a very good question.

*

*Given a symplectic manifold $(M,\omega)$ let there be given a time-dependent generator $G\in C^{\infty}(M\times \mathbb{R})$ of a Hamiltonian vector field $X_G$. Then we have a 1-parameter symplectic flow, here written in local canonical/Darboux coordinates
$$\begin{align}
\frac{dz^I_{\lambda}}{d\lambda}~=~& \{G(z_{\lambda},t),z^I_{\lambda}\}, \cr
z^I_{\lambda} ~=~&e^{\lambda\{G(z_0,t),\cdot\}} z^I_0\cr ~=~&z^I_0 +\lambda\{G(z_0,t),z^I_0\} 
+{\cal O}(\lambda^2), \cr 
I~\in~&\{1,\ldots, 2n\},\cr 
(z^1_{\lambda},\ldots, z^{2n}_{\lambda})~=~&(q^1_{\lambda},\ldots, q^{n}_{\lambda},p_{1\lambda},\ldots, p_{n\lambda}).
 \end{align}\tag{1}$$


*Note that only type-2 and type-3 (but never type-1 and type-4) CTs are guaranteed to exist in a neighborhood of the identity CT. Let us therefore pick a 1-parameter type-2 generating function
$$\begin{align}
F_2(q_0,p_{\lambda},t,\lambda)~=~&q^i_0 p_{i\lambda} +\sum_{m=1}^{\infty}\frac{\lambda^m}{m!} F_{2m}(q_0,p_{\lambda},t),\cr
 q^i_{\lambda} 
~=~ \frac{\partial F_2(q_0,p_{\lambda},t,\lambda)}{\partial p_{i\lambda} }
~=~& q^i_0  +\sum_{m=1}^{\infty}\frac{\lambda^m}{m!} \frac{\partial F_{2m}(q_0,p_{\lambda},t)}{\partial p_{i\lambda} } ,\cr
p_{i0} 
~=~ \frac{\partial F_2(q_0,p_{\lambda},t,\lambda)}{\partial q^i_0}~=~& p_{i\lambda}  +\sum_{m=1}^{\infty}\frac{\lambda^m}{m!} \frac{\partial F_{2m}(q_0,p_{\lambda},t)}{\partial q^i_0 } ,\cr
i~\in~&\{1,\ldots, n\}.
\end{align}\tag{2}$$
(There are similar expressions for a type-3 CT.)
As one can imagine the relationship between $F_2$ and $G$ is quite intricate in general, cf. OP's question.


*Let us for simplicity consider an infinitesimal CT, i.e. let $\lambda$ be infinitesimally small. Then one may show that the relationship is
$$\begin{align} F_2(q_0,p_{\lambda},t,\lambda)
~=~&q^i_0p_{i\lambda}- \lambda G(q_0,p_{\lambda},t)
+{\cal O}(\lambda^2)\cr
~=~&q^i_0p_{i\lambda}- \lambda G(q_0,p_0,t)
+{\cal O}(\lambda^2),
\end{align}\tag{3} $$
cf. Ref. 1.
References:

*

*H. Goldstein, Classical Mechanics; eq. (9.62).

