Generalizing the "Extended System Method" After looking into molecular dynamics simulations for NVT and NPH ensembles, I noticed a peculiar kind of Lagrangian transform they do.
Starting with a Lagrangian like,
\begin{align}
\mathcal{L}(q, \dot{q}) = \frac{1}{2} \sum_i \| \dot{q}_i \|^2 + U(q)
\end{align}
In Andersen, Hans C. "Molecular dynamics simulations at constant pressure and/or temperature." The Journal of chemical physics 72.4 (1980): 2384-2393. (also in this), the author makes a transform to a new Lagrangian,
\begin{align}
\mathcal{L}_P(\phi, \dot{\phi}, V, \dot{V}) = \mathcal{L}(V^{1/3} \phi, V^{1/3} \dot{\phi}) + \frac{\eta}{2} \dot{V}^2 + P V
\end{align}
where $ P $ is the conserved pressure and $ \eta $ is the "mass" of the piston. With this new scaled space (ie. $ q \rightarrow q/V^{1/3} $) Lagrangian, the author proves that pressure is conserved.
Similarly, in Nosé, Shuichi. "A unified formulation of the constant temperature molecular dynamics methods." The Journal of chemical physics 81.1 (1984): 511-519., the author transforms to,
\begin{align}
\mathcal{L}_T(\phi, \dot{\phi}, s, \dot{s}) = \mathcal{L}(\phi, s \dot{\phi}) + \frac{\nu}{2}\dot{s}^2 + g k T \log s
\end{align}
with $ T $ being the conserved temperature and $ \nu $ the "mass" for the time scaling term. The author then proves that this time scaled (ie. $ dt \rightarrow dt/s $) lagrangian conserves temperature.
There is a noticeable symmetry here. Space scaling gives pressure conservation while time scaling gives temperature conservation. I would imagine this could be done for a number of ensemble control parameters, like external field magnetization.
What is the generalization to this method?
EDIT:
I guess it would be useful to know what I am looking for. Imagine I discovered that energy and momentum generate space-time translation in Quantum. I would like to be pointed to Lie-groups and their applications in Quantum and QFT. Same this here, just for this subject.
 A: Consider a Hamiltonian transform like,
\begin{align}
\mathcal{H}_\Lambda\big(q', p', \phi, \pi\big) &=  \mathcal{H}\big(q(q', \phi), p(p', \phi)\big) + \mathcal{H}_\phi(\phi, \pi; \Lambda) \\
\end{align}
where $ \phi $ serves the purpose of $ s, V $ above and $ \pi $ is its momentum variable. $ \Lambda $ is our temperature or pressure kind of variable.
Simulating Hamiltons equations generates a microcanonical distribution with a partition function (ie. density of states),
\begin{align}
\mathcal{Z}_\Lambda &= \int d\phi~d\pi \int d^Nq'~d^Np'~\delta\big[ \mathcal{H}_\Lambda\big(q', p', \phi, \pi\big) - E\big] \\
  &= \int d\phi~d\pi \int d^Nq~d^Np~\mathcal{J}(\phi)~\delta \big[\mathcal{H}\big(q, p\big) + \mathcal{H}_\phi(\phi, \pi; \Lambda) -
 E\big]
\end{align}
where the Jacobian is $ \mathcal{J}(\phi) = \left[ \frac{\partial^N q'}{\partial^N q} \frac{\partial^Np'}{\partial^Np}\right] $
You can use something like a Dirac delta function property or a Laplace transform
From the composition property,
\begin{align}
\mathcal{Z}_\Lambda &= \sum_i \int d\pi~d^Nq~d^Np~\frac{\mathcal{J}(\phi^{(0)}_i)}{\frac{\partial}{\partial \phi} \mathcal{H}_\phi \big|_{\phi^{(0)}_i}} \\
  &= \frac{1}{i2\pi} \int_{i\mathbb{R}} d\beta~e^{\beta E} \int d\phi~d\pi \int d^Nq~d^Np~e^{ -\beta \big[ \mathcal{H}(q, p) + T(\pi) + U(\phi;\Lambda) - \beta^{-1} \log \mathcal{J}(\phi) \big] } \\
  &= \frac{1}{i2\pi} \int_{i\mathbb{R}} d\beta~e^{\beta E} \int d\phi~d\pi~e^{ -\beta \big[T(\pi) + U(\phi;\Lambda) - \beta^{-1} \log \mathcal{J}(\phi) \big] } \mathcal{Z}(\beta, N)
\end{align}
Where $ \phi^{(0)}_i $ is a zero of $ \mathcal{H}\big(q, p\big) + \mathcal{H}_\phi(\phi, \pi; \Lambda) -
 E $ and $ \mathcal{H}_\phi(\phi, \pi; \Lambda) = T(\pi) + U(\phi;\Lambda) $
NVT Ensemble
\begin{align}
\mathcal{H}_\phi(\phi, \pi; T) &= \frac{1}{2} \pi^2 + (3N+1)T \log \phi ~~;~~
\phi^{(0)} = e^{- \frac{\mathcal{H}(q, p) + \frac{1}{2} \pi^2 - E}{(3N+1)T}} ~~;~~
\mathcal{J}(\phi) = \phi^{3N} ~~;~~
\frac{\partial}{\partial \phi} \mathcal{H}_\phi &= \frac{(3N+1)T}{\phi} \\
\mathcal{Z}_\Lambda &= (3N+1) T \int d\pi~d^Nq~d^Np~e^{- \frac{\mathcal{H}(q, p) + \frac{1}{2} \pi^2 - E}{(3N+1)T} (3N + 1)} \propto \int d^Nq~d^Np~e^{- \frac{\mathcal{H}(q, p)}{T}}
\end{align}
