Solving Hamilton-Jacobi via canonical transformations 
Given a solution to a Hamilton-Jacobi equation in $(X, P)$ variables and a canonical transformation from $(x, p)$ to $(X, P)$, how does one write down the solution to the Hamilton-Jacobi in terms of the variables $(x,p)$? 

I know this is a classical question with a known answer. Despite several attempts, I haven't been able to complete the calculation. I am hoping an expert can find a computationally tractable way of writing down a solution.
Given the Hamiltonian $H : \mathbb{R}_+ \times \mathbb{R} \rightarrow \mathbb{R}$, 
$$ H(x,p) = x(e^{-p} - 1) + e^p - 1, $$
and the type-2 generating function 
$$F_2(x, P) = x \log(P+1) - P,$$
we find the following transformation to be canonical:
\begin{align*}
x(X, P) &= (X+1)(P+1) \\
p(X, P) &= \log(P+1).
\end{align*}
Substituting in $H$, we obtain the "Kamiltonian" $K(X, P) = - XP$. A solution $V(t, X)$ to the Hamilton-Jacobi equation
$$ \frac{\partial V}{\partial t} + K\left(X, \frac{\partial V}{\partial X}\right) = 0$$
is given by 
$$ V(t, X) = X^2 e^{2t}. $$
How can we use this to write down a solution $S(t, x)$ to the original Hamilton-Jacobi equation,
$$ \frac{\partial S}{\partial t} + H\left(x, \frac{\partial S}{\partial x}\right) = 0?$$
If there are some expressions which are difficult to invert, what is an explicit relationship between $S$ and $V$?

Edit, following secavara's hints.
With $V(t, X) = \alpha X e^t$, we first rewrite $(x, p)$ in $x(\beta, \alpha, t)$ and $p(\beta, \alpha, t)$. We find
\begin{align*}
x &= (\beta e^{-t} + 1)(\alpha e^t + 1) \\
p &= \log(\alpha e^t + 1).
\end{align*}
To fulfill $\partial_x S = p$, we might try
$$S(x, \alpha, t) = x \log(\alpha e^t + 1) + g(\alpha, t).$$
for some arbitrary function $g(\alpha, t)$. We can verify that with $g(\alpha, t) = -\alpha$, we satisfy $\partial_\alpha S = \beta = X e^t$. 
At this point I tried to get the last relationship to work out, $\partial_t S = -H$, but didn't manage (though, granted, I didn't try very hard). Instead, I ansatzed the following solution:
$$ S(t, x) = x \log x - x + a(t) x + b(t). $$
Plugging in to the HJE, we find the following relationships:
\begin{align*}
\dot{a}(t) &= -(e^{a(t)} - 1) \\
\dot{b}(t) &= -(e^{-a(t)} - 1). 
\end{align*}
A solution to the HJE is therefore
$$S(t, x) =  x\log x - x - x\log(e^{-t+c_1} + 1) + e^{-t+c_1} + c_2$$
for constants $c_1, c_2$. The constant $c_1$ plays the role of $\alpha$. Does $c_2$ play the role of $\beta$? 
My issue with this solution is that I seem unable to satisfy a boundary condition such as $S(0, x) = 0$ if $x = y$ and $S(0, x) = +\infty$ if $x \neq y$ for some fixed $y \in \mathbb{R}_+$. This might be possible if we had a term such as $-(x-y)\log(1-e^{-t}).$ One can satisfy such a boundary condition in the simple case of a free particle, say $H'(p) = p^2/2$. Then $S(t, x) = (x-y)^2/2t$ satisfies the same HJE (with Hamiltonian $H'$) and $S(0, x) = \infty\cdot 1\{x \neq y\}$. Do you see any way of getting this for our $H$?
Finally, it seems to me that the $\alpha, \beta$ constants are related to the following canonical transformation from $(X, P)$ to $(E, Q)$ variables:
\begin{align*}
X = \sqrt{E} e^{-Q} \\
P = \sqrt{E} e^{Q}.
\end{align*}
Then $K(X(E, Q), P(E, Q)) = -E$, and we have "action-angle" coordinates. I hesitate to call them action-angle because the phase space is not compact, so there is no cyclic variable. This system can be viewed as a harmonic oscillator rotated by $p \rightarrow i p$, i.e., $H''(x, p) = x^2 - p^2$. I am not sure how to interpret it. 
 A: The way I rationalize the Hamilton-Jacobi process is by thinking of the solution to the HJ equation as an $F_2$ generating function that leads to a trivial Kamiltonian (although I think in some references they take other types of generating functions). So, in sum, the HJ process is a very convenient canonical transformation.
In your case, you seem to perform first a canonical transformation, and then solve the HJ equation for the transformed Hamiltonian, coordinates and momenta. So, you see, in my mind, while you managed to solve the problem, you did this by doing effectively 2 canonical transformations: one intermediate one and one related to the solution of the HJ equation. In some way, your $S$ is the type 2 generating function that accounts for the composition of these 2 transformations.
One thing you can try to do is to invert these 2 canonical transformations. Try using the relations between derivatives of $V$ and the $X$ and $P$ coordinates to deduce the corresponding canonical transformation: usually this will allow you to write $X$ and $P$ in terms of 2 constants and possibly time. Once this is done, you might be able to invert all the way to $p$ and $x$, so that that you literally solve the dynamic problem since you end up with $x$ and $p$ written in terms of these 2 constants and time. Then if you really need $S$, then $S$ corresponds to the type 2 generating function associated to the canonical transformation that takes you from $(x,p)$ to the 2 constants you picked. Depending on how ugly the results were so far, this might be hard or not, but I think that when it's framed as this, the problem sounds more textbook standard as many exercises ask you to find an $F_2$ given a specific canonical transformation.
EDIT:
After some checks, I can give you some hints on how to proceed. The first thing to take into account is that you can find much more general solutions $V$ for your HJE. For instance, you can take
\begin{equation}
V_r = \alpha_r \, X^r \, \mathrm{e}^{r t} \, ,
\end{equation}
with $r$ and $\alpha_r$ constants. Or you can take 
\begin{equation}
V_\gamma = \gamma \, \left( \log X + t \right) \, ,
\end{equation}
with $\gamma$ a constant. Or you can even take a superposition of the form
\begin{equation}
V = V_\gamma + \sum_r V_r \, .
\end{equation}
It is a very rich space of solutions, which in other contexts would be constrained by boundary or initial conditions. But here it offers us the possibility of picking the solution that simplifies our computations. After some experimentation, it turns out that
\begin{equation}
V = V_{r=1} = \alpha \, \, X \, \mathrm{e}^{t} \, ,
\end{equation}
simplifies our lives a lot (here I simply picked $\alpha_1 = \alpha$). The rest of the problem becomes much more tractable than when you use your original choice for $V$.
Now you can use the type 2 relations
\begin{equation}
P = \frac{\partial V}{\partial X} \, \, \mathrm{and} \, \, \beta = \frac{\partial V}{\partial \alpha} \, .
\end{equation}
This allows you to write $X$ and $P$ as a function of $t$ and the constants $\beta$ and $\alpha$. With this, you'll be able to write $x$ and $p$ in terms of the same variables, using the canonical transformation. Now, in order to find $S$, you want to focus on the canonical transformation that goes from $(x,p)$ to $(\beta,\alpha)$. Since $S$ is type 2, you want to find an $S(x,\alpha,t)$ such that:
\begin{eqnarray}
p &=& \frac{\partial S}{\partial x} \, ,
\\
\beta &=& \frac{\partial S}{\partial \alpha} \, ,
\\
- H &=& \frac{\partial S}{\partial t} \, .
\end{eqnarray}
Fortunately, with our choice of HJE solution, this is now a much simpler problem.
