A physics note before I start:
Every atmosphere is escaping, awalys.
The catch is just that some bodies have escape rates so low, that we don't notice on the timescale of the age of the universe.
That being said, what you're searching for here sounds like a cold trap.
You need a layer of a chemical species S at some height $H_0$ that forms at $H_0$ from other species below and is very good at cooling. An example for this could be Carbon-monoxide in Pluto's atmosphere, but Earth doesn't have really strong coolants. Earth's atmosphere is mostly cooling passively by all stuff simply being transparent or near-transparent (except for greenhouse gases).
The constituents of S can be upwelled from below by convection or diffusion or of course, technology.
Then the cooling properties of S will lead to local slowdown of molecules at $H_0$, as well as increase in density of the layer S resides in.
The slowdown in individual molecular velocities will prevent Jeans escape and the overdensity will prevent launching a hydrodynamic escape of the atmosphere.
Some more hard science, if you're interested:
Depending on how much physics modelling you want to put into your moons atmosphere you need to satisfy that $H_0 < r_s$, with $r_s = \frac{GM_{planet} \mu}{4 k_B T}$ being the sonic point, $\mu$ the mean molecular mass, $T$ the temperature at the sonic point, to prevent hydro escape.
Also it must be $H_0 < r_e$, with $r_e$ being the exobase of the atmosphere, to prevent Jeans escape (mostly).
Also you might not feel too warm on the surface, as any atmosphere will allow only for a certain temperature rise per km, so when you put $H_0$ too close to the surface, the surface will be cold. If you put $H_0$ too far away from the surface, you might be warm and cozy, but you could reach the sonic point or the exobase.