Let us take, for example, a generator function of type 2 (please see goldstein), i.e , F2(q,P,t) function of the old coordinates (q) and the new momenta (P), and consider the following non-relativistic transformation:
x=x'+Vt , x'- new (spacial) coordinate
t=t' , (time remains the same)
as you can see, you will also have to know how the momenta transforms (in order to determine F2)
px=mV+px' , px' new momentum (px'=P, if you prefer)
For the type 2 generator function,
p=dF2/dq (partial derivative)
Q=dF2/dP (partial derivative)
So, all you have to do is integrate, i.e
px is your old momentum, therefore F2 = (mV+px')x + A
now let's determine A,
"A" is not a constant because if you take dF2/dP it won't equal the new momenta. There's still a " - Vtpx' "
lacking in the equation (with the minus sign included).
Well if that quatity is missing , all we have to do is add it to the equation (A=-Vtpx').
So here it is, the F2(q,P,t) generator function for this non-relativistic transformation is:
F2 = (mV+px')x - Vtpx'
I down know if there is another (better) way to do it, but I hope it helps.
Best regards
Rico B.