Alright let me see if I can clear things up a little bit. Let $(M,g)$ be a Riemannian manifold, and say we have a coordinate chart $(U,\phi)$ with coordinates $x^i$. Then locally, in this coordinate chart we can write vector fields as:
$$X=X^i\frac{\partial}{\partial x^i}$$
where the $\partial/\partial x^i$ are the coordinate frame on $U$, and the $X^i$ are smooth functions on $U$.
We also have a coordinate coframe given by the differential of the coordinate functions, i.e. any one form can be locally written in coordinates as:
$$\omega=\omega_idx^i$$
where again $\omega_i$ are smooth functions on $U$, and as mentioned the $dx^i$ form a coordinate coframe. These $dx^i$ are dual to the coordinate frame in the sense that:
$$dx^i\left(\frac{\partial}{\partial x^j}\right)=\delta^i_j$$
where $\delta^i_j$ is the constant function on $U$.
Now, a Riemannian metric $g$ is just a smoothly varying inner product on each tangent space, i.e. a global smooth section of $T^*M\otimes T^*M$ which is symmetric, non degenerate, and positive definite. We define the components of the metric tensor $g$ with respect to the coordinate frame on $U$ by:
$$g\left(\frac{\partial}{\partial x^i},\frac{\partial}{\partial x^j}\right)=g_{ij}$$
These $g_{ij}$ are literally just smooth functions on $U$. Moreover, we have a coordinate frame for $T^*M\otimes T^*M$ is given by the set $\{dx^i\otimes dx^j\}$, so we can write $g$ locally as:
$$g=g_{ij}dx^i\otimes dx^j$$
Indeed, if we plug in a pair of coordinate vectors $\partial/\partial x^k$, $\partial/\partial x^l$ we have:
$$g\left(\frac{\partial}{\partial x^k},\frac{\partial}{\partial x^l}\right)=g_{ij}dx^i\left(\frac{\partial}{\partial x^k}\right)dx^j\left(\frac{\partial}{\partial x^l}\right)=g_{ij}\delta^i_k\delta^j_l=g_{kl}$$
In particular, if we vector fields $X=X^i\partial/\partial x^i$ and $Y=Y^j\partial/\partial x^j$, then:
$$g(X,Y)=g_{ij}X^iY^j$$
We can now define a smooth vector bundle isomorphism $TM\rightarrow T^*M$ by taking an element $v_p\in T_pM$ and defining a covector in $T^*_pM$ by:
$$g(v_p)(w_p)=g(v_p,w_p)$$
This is smooth because on local sections of $TM$ (i.e. local vector fields) we obtain that $g(X)$ is defined by:
$$g(X)(Y)=g(X,Y)$$
which as we saw earlier was a sum of smooth functions. Now, in the coordinate frame, this must be given by:
$$g(X)=g_{ij}X^idx^j$$
so the matrix in the coordinate frame is given by $g_{ij}$.
Now suppose we have a different frame $E_i$, then we can define new functions $\tilde{g}_{ij}$ by:
$$g(E_i,E_j)=\tilde{g}_{ij}$$
With this new frame, we have an new coframe which we denote by $E^i$, so in this frame we have that:
$$g=\tilde{g}_{ij}E^i\otimes E^j$$
If we want to write this in terms of our original $g_{ij}$, note that there is a matrix of smooth functions $B$ such that:
$$E_i=B_i^j\frac{\partial}{\partial x^j}$$
then:
$$
\begin{align}
g(E_i,E_j)=&g\left(B_i^k\frac{\partial}{\partial x^k},B_j^l\frac{\partial}{\partial x^l}\right)\\
=&B_i^kB_j^lg\left(\frac{\partial}{\partial x^k},\frac{\partial}{\partial x^l}\right)\\
=&B_i^kB_j^lg_{kl}
\end{align}$$
hence we have that:
$$\tilde{g}_{ij}E^i\otimes E^j=B_i^kB_j^lg_{kl} dx^i\otimes dx^j$$
so:
$$g(X^iE_i)=\tilde{g}_{ij}X^iE^j=B_i^kB_j^lg_{kl}X^idx^j$$
So to sum up, it doesn't matter what frame you use, you just have to be able to switch between them when the need arises. Oftentimes it is convenient to use coordinate frames, other times it easier to use orthonormal frames. I suggest you derive for yourself what the transformation law is locally between two coordinate frames. When working in coordinates, or locally in general things can get confusing sometimes I find, so it's best to work out a lot of this on your own to get a clear idea of what is going on.
The matrix of a a linear map depends on the chosen basis. For a coordinate frame, we have $g_{ij}:=g(\partial/\partial x^i,\partial/\partial x^j)$. If you choose a different frame $E_i=E^j_i \partial/\partial x^j$, your matrix in this new basis will not be $g_{ij}$ but rather $\tilde g_{ij}=g(E_i,E_j)$.
– WishYouTheBest Nov 06 '23 at 16:47