Deriving a generator $G(q,p)$ given certain conditions So let's consider a mechanical system in Lagrangian and Hamiltonian formalism; it has Lagrangian $L(q,q',t)$ and Hamiltonian $H(q,p,t)$.
I know that $L$ invariant under infinitesimal changes $q → q + εK(q),$ where $ε$ is an infinitesimal value.
How do I find the generator $G(q, p)$ of the corresponding phase-space map?
 A: The generator is the conserved quantity associated to the symmetry of the Lagrangian through Noether's theorem.
In that case, assume the Lagrangian is invariant under $q\mapsto q + \delta q$. Writing $\delta q = \epsilon K(q)$ as you did, Noether's theorem says that the quantity
$$Q=\dfrac{\partial L}{\partial \dot{q}}K(q),$$
is conserved. Now $Q$ itself is what generates the symmetry transformation on the Hamiltonian picture.
As an example, conservation of momentum. The transformation is given with $K(q)=1$ constant. Then, $Q = p$ itself by definition of the conjugate momentum.
Now recall that the Poisson bracket is
$$\{f,g\}=\sum \dfrac{\partial f}{\partial q^i}\dfrac{\partial g}{\partial p_i}-\dfrac{\partial f}{\partial p_i}\dfrac{\partial g}{\partial q^i},$$
so that $\{,Q\}$ is a vector field on the phase space manifold, since it is a derivation. In the case $Q = p$ we have
$$\{f,p\}= \dfrac{\partial f}{\partial q} \dfrac{\partial p}{\partial p}-\dfrac{\partial f}{\partial p}\dfrac{\partial p}{\partial q}=\dfrac{\partial f}{\partial q}.$$
In other words, the vector field $X$ which must be $Xf = \{f,p\}$ is
$$X = \dfrac{\partial}{\partial q},$$
whose flow moves points along the coordinate lines of $q$, and hence translates in $q$. In other word, the symmetry "moving along the flow of $X$" is indeed $q\mapsto q + \epsilon$ as we antecipated.
Now for the general setting. We want to show that with $Q$, forming $X = \{\cdot, Q\}$ the motions along $X$ are indeed $q\mapsto q + \delta q$ with $\delta q = \epsilon K(q)$.
So first of all, notice that in phase space $Q = p K(q)$. Thus we evaluate
$$\{f,Q\}= \dfrac{\partial f}{\partial q}\dfrac{\partial (pK(q))}{\partial p}-\dfrac{\partial f}{\partial p}\dfrac{\partial (pK(q))}{\partial q}=\dfrac{\partial f}{\partial q}K(q)-\dfrac{\partial f}{\partial p} p K'(q).$$
Thus our vector field is
$$X = K(q) \dfrac{\partial}{\partial q}- p K'(q) \dfrac{\partial}{\partial p}.$$
This means that an infinitesimal motion of lenght $\epsilon$ along $X$ in phase space shifts $q$ by $K(q)\epsilon$ and shifts $p$ by $-pK'(q) \epsilon$.
Well, the first observation is exactly what we claimed, since this means $q\mapsto q + \epsilon K(q)$, while the second conclusion is how the symmetry transformation affects the momenta.
So to answer your question, the generator is $G(p,q)=p K(q)$.
