[Physics] Why is $ds^2=0$ along the path of a light ray in any spacetime, in any reference frame, specifically non-inertial

differential-geometrygeneral-relativitymetric-tensorspacetimespeed-of-light

In the Minkowski spacetime of special relativity it is apparent that along the path of a light ray $ds^2=0$ in any inertial reference frame given the Lorentz transformations and the invariance of $ds^2$. However this does not seem so apparent to me in the context of a curved spacetime given all reference frames, to my knowledge, are non-inertial. I have seen this taken to be fact in the context of curved spacetimes and have not came across justification for it yet.

QUESTION: Is there a rigorous mathematical proof that $ds^2=0$ along the path of a light ray, in any spacetime, in any reference frame, or is this an axiomatic fact?

Note: I assume this can be proven mathematically somehow and would be very interested in what the proof/logic is behind it. Also, the only curved spacetime I'm sufficiently familiar with is that described by the Schwarzschild metric.

So, in general, a coordinate transformation involves giving each coordinate $x$ as a function of the new coordinates $x^{\prime}$:
$$x^{\prime\mu} = f^{\mu}(x^{\nu})$$
$$ds^{2} = g_{\mu\nu}dx^{\mu}dx^{\nu} = g_{\mu \nu}\left(\frac{dx^{\mu}}{dx^{\prime\alpha}}dx^{\prime \alpha}\right)\left(\frac{dx^{\nu}}{dx^{\prime\beta}}dx^{\prime \beta}\right) = g_{\alpha \beta}^{\prime}dx^{\prime \alpha} dx^{\prime \beta}$$
Where we can transform the old inner product defined by $g$ into a new inner product defined by $g^{\prime}$. So, if $ds^{2}=0$ in our old reference frame, then it is necessarily zero in our new reference frame. You can argue that the formalism is cooked to make this true, and you'd be right, but that's what the underlying mathematics of general and special relativity describe.