I am a bit confused about the way that Lorentz invariance of the scalar product $A^\mu g_{\mu\nu}B^\nu$ is proved. Usually, the proof would go like this (see also e.g. this Physics SE question). The transformed product is $A^{'\mu}g_{\mu\nu}B^{'\nu} = g_{\mu\nu}\Lambda^{\mu} _{\ \ \ \rho}A^\rho\Lambda^{\nu} _{\ \ \ \sigma}B^\sigma = A^\rho g_{\rho\sigma}B^\sigma $, since we define Lorentz transformations by the condition $\Lambda^{\mu} _{\ \ \ \rho}g_{\mu\nu}\Lambda^{\nu} _{\ \ \ \sigma}=g_{\rho\sigma}$.
However, if we say that the metric $g_{\mu\nu}$ is a tensor, should not the transformation of the scalar product also involve a transformation of the metric, i.e. $A^{'\mu}g' _{\mu\nu}B^{'\nu}$? This quantity would be automatically invariant, for any kind of transformation, since lower indices transform with the inverse transformation. In other words, the quantity $A^\mu g_{\mu\nu}B^\nu$ would be automatically invariant, without any conditions on the transformation actually being a Lorentz transformation, since it is a fully contracted tensor. What am I missing here?