The use of inertial frames in Lagrangian mechanics is by no means compulsory and everything can be done in any reference frame provided one takes all forces, real and inertial, into account.
Actually there are two possibilities in interpreting the question.
We work in a non inertial frame $R'$ (instead of an inertial one $R$) because we are adopting coordinates $q'^k$ at rest with $R'$. In other words: If we keep all the $q'^k$ fixed, the points of matter the physical system stay at rest in $R'$.
We work in a non inertial frame $R'$ (instead of an inertial one $R$) because the Lagrangian encompasses all forces (real forces and inertial ones) appearing in $R'$.
These are two completely independent viewpoints whose interplay I go to illustrate.
Everything relies upon the following general result.
I will refer now to a generic pair of reference frames $R$ and $R'$ without assuming that one of both are inertial.
Proposition.
Suppose that a Lagrangian $L|_R(r,q, \dot{q})$ is both
(a) constructed out of the forces appearing in a reference frame $R$,
(b) using coordinates $q^k$ at rest with that frame.
If that Lagrangian is described passing to coordinates $q'^h$ ($*$) at rest with another reference frame $R'$, i.e,:
$$L'|_R(t, q', \dot{q}'):= L|_R(t, q(t,q'), \dot{q}(t,q', \dot{q}'))$$
then it produces the correct equations of motion in $R'$, though, in general it may happens that:
$$L'|_R(t, q', \dot{q}') \neq L|_{R'}(t, q', \dot{q}')$$
where, in the RHS a Lagrangian takes place directly constructed out of all the forces manifesting in $R'$ and referred to coordinates at rest with $R'$.
The said result has two remarkable consequences: (i) The Lagragian of a given system is not uniquely given, (ii) as soon as we make a choice of a Lagrangian of a system we can suppose that it transform as scalar without affecting the equations of motion, written in whatever reference frame.
The mentioned result implies something for the special case where $R$ is inertial and $R'$ is not. Let us start constructing $L|_R$ in $R$. For the sake of simplicity we stick to the form:
$$L|_R(t,q, \dot{q}) = T|_R(q,\dot{q}) - U|_R(q)\quad (1)$$
i.e. all forces are supposed to be conservative in $R$. The more general case of real forces due to a generalized potential (see below), like electromagnetic forces, does not involve any further difficulty.
In $R'$ the real forces associated with $U$ keep existing, but new inertial forces show up described by some added term $-V$ below, so the Lagrangian must be of the form:
$$L|_{R'}(t,q', \dot{q}') = T|_{R'}(q',\dot{q}') - U|_R(q(t,q')) - V(t, q', \dot{q}')\quad (2)$$
Making use of (1) and (2) we conclude that:
$$V(t,q',\dot{q}') = T|_{R'}- T|_R \quad (3)$$
It is easy to see, by direct inspection form (3), that:
$$V(t,q',\dot{q}') = \phi(t,q') + \sum_{k=1}^n A_k(t,q')\dot{q}'^k\quad (4)$$
This object is called a generalized potential. Physicists are familiar with it, because it appears when dealing with the Lagrangian of charged particles immersed in a given (non-stationary) electromagnetic field. Inertial forces are described by a similar theoretical object. A closer scrutiny of the motion equations:
$$\frac{d}{dt} \frac{\partial L|_{R'}}{\partial \dot{q}'} -
\frac{\partial L|_{R'}}{\partial q'}=0$$
namely:
$$\frac{d}{dt} \frac{\partial T|_{R'}}{\partial \dot{q}'} -
\frac{\partial T|_{R'}}{\partial q'}= -\frac{\partial U|_R(q(t,q')) }{\partial q'}
- \frac{\partial V}{\partial q'} + \frac{d}{dt} \frac{\partial V}{\partial \dot{q}'} $$
proves that the last two terms in the RHS are, in fact, responsible for all inertial forces (e.g. centrifugal and Coriolis' forces and all remaining ones for a generic motion of $R'$ with respect to $R$). In a sense, in particular Coriolis' force is similar to magnetic force and is associated with the functions $A_k$ in (4).
footnotes
($*$) I assume here that the coordinate transformation is adapted to the structure of the manifold on which $L$ is defined. The structure is that of a fiber bundle (a jet bundle) over the line of time $\mathbb R$. So:
$$t'=t\:, \quad q'^k = q'^k(t,q)\:, \quad \dot{q}'^k = \frac{\partial q'^k}{\partial t} + \sum_{h=1}^n \frac{\partial q'^k}{\partial q^h} \dot{q}^h$$
Best Answer
Let the equations of motion be expressed in a frame with coordinates $q$. We now want to switch over to another (arbitrarily moving) frame, whose corresponding coordinates are $Q$, given by: $$Q = f(q, t)$$ For example, if the frame itself is moving with position $x(t)$, we will have: $$Q = q - x(t)$$ (where $x$ is not dynamic, but is completely specified in advance).
This is quite obviously, in the general case, just a point transformation that keeps changing with time; or, if you prefer, a different point transformation at different times. And that's the way one might expect it to be - this follows directly from the fact that the moving frame is moving.
This does not necessarily leave the equations of motion invariant. It's true that Euler-Lagrange equations (note that the Lagrangian must now be allowed to be time dependent) $$\frac{d}{dt}\frac{\partial L(q, \dot{q}, t)}{\partial \dot{q}} = \frac{\partial L(q, \dot{q}, t)}{\partial q}$$ continue to hold, but the change in the form of the Lagrangian effected by the change of frame means that the equations of motion can 'look' different.
In the case that this point transformation is also a gauge transformation, we have a special situation. Consider the following/relevant example. In classical mechanics, from an inertial frame, the Lagrangian is: $$L(q, \dot{q}) = \frac{1}{2}m\dot{q}^2 - V(q)$$ The general transformation to an arbitrary moving (non-rotating, for simplicity) frame is given by $q = Q + x(t)$, so that $\dot{q} = \dot{Q} + \dot{x}(t)$, and the Lagrangian becomes: $$L(Q, \dot{Q},t) = \frac{1}{2}m\dot{Q}^2 + m\dot{Q}\dot{x}(t) + \frac{1}{2}m\dot{x}(t)^2 - V(Q+x(t)) $$ The term quadratic in $\dot{x}$ produces only a pure-boundary term in the action $S = \int L dt$, and is irrelevant. The main term of interest is the second one (responsible for the fictitious forces, and part of the generalized potential, as mentioned in this answer to the question you linked), and it's contribution to the action: $$S_2 = \int m\dot{Q}\dot{x}(t)\ dt$$ Integrating by parts and neglecting the boundary term, we get $$S_2' = -\int mQ\ddot{x}(t) \ dt$$ This readily gives the answer - for the "time-dependent point transformation", which corresponds to a change of frame, to be a gauge transformation, we must have $\ddot{x}(t) = 0$ for all time. In this case, we get the important part of the action as: $$S' = \int \left[ \frac{1}{2}m\dot{Q}^2 - V(Q, t) \right] dt$$ This is hardly any different from the one we started with (the time dependence in $V$ is not an issue, and is just a reflection of the fact that the "field" would also appear to move in a moving frame; the important thing is that at a given time $t$, the particle sees the same force $-\nabla V$ at its location in both frames).
This is indeed, what makes inertial frames ($\ddot{x} = 0$ as seen from another inertial frame) special - the general point-transformation due to switching frames reduces to a gauge transformation, and the equation of motion 'looks' the same i.e. 'Galilean invariance'. That this doesn't occur in non-inertial frames leads to the fictitious forces seen in such frames.