Is the assumption that the two reference frames be inertial required in the derivation of transformation equations?

In the derivation of Galilean transformations the only assumption is that the two frames are moving with some uniform relative velocity $u$.

Suppose with respect to some inertial frame $O$ the two frames $S$ and $S'$ are moving with the same uniform acceleration $a$.

Let $V$ be the velocity of $S$ w.r.t. $O$. Similarly, let $V'$ be the velocity of $S'$ w.r.t. $O$. Furthermore, let $V_0' - V_0 = u$ (const.). Then

$$V = V_0 + at$$ $$V' = V_0' + at$$

Then the relative velocity is $V' - V = u$.

This is the only result required in deriving the Galilean transformation. So why do people assume that the reference frames be inertial. (I know the point is so that Newton's laws would be valid, but exclusively in the derivation of the transformation equation is this assumption needed?) The same applies in the derivation of Lorentz transformation.

-

I would write a comment but i don't have the privilege so am writing an answer

"In the derivation of Galilean transformations the only assumption is that the two frames are moving with some uniform relative velocity u."

Hint: "In the derivation of Galilean transformations the only assumption is that the two frames are moving with respect to each other with some uniform relative velocity u."
PS: Since you have marched towards relativity remember every measurement is taken w.r.t some frame of reference(coordinate system). $S$ and $S^{'}$ are inertial w.r.t each other but are non-inertial w.r.t $O$.
That's true if both frames are accelerating at a uniform velocity - your coordinate transformations would be the same even if Newtonian physical laws don't hold. If they have two separate accelerations then the law "$\mathbf{V'}-\mathbf{V}=u$" (where $u$ is independent of time) holds, and your equation for $v'$ in the frame of $S$ will look Galilean.
The special relativistic version of this would be different. One issue is usually phrased as: If you tie a string between two spaceships accelerating uniformly (with the same acceleration) separated by some distance, the string will break. (Bell's Spaceship Paradox) Since in one frame the other spaceship would look as if it accelerated away, clearly you can't have events transform linearly from one frame to the other, so the Lorentz transform won't hold. I don't know if there's some configuration of reference frames and accelerations that would allow this to hold - that would be something to prove, and you can ask it on stackexchange after phrasing the question precisely! (and giving it a shot yourself. I'd phrase it as something like, "Given a frame $S_1$ and $S_2$, with positions $X_1(t)$ and $X_2(t)$, with $X_1(0)=x_2(0)$ in inertial reference frame $O$, what restrictions must be placed on $X_1$ and $X_2$ so that events transform in a Lorentz-like way from one frame to another? More specifically, do they have to have zero second derivative always." [to avoid lack of clarity, when I say "frame" here I mean "instantaneous rest frame".] )