I'm just a beginner of differential geometry, so please forgive me if this is nothing but a silly question or I'm making a critical conceptual mistake.
Let $\mathrm{I\!I}(X, Y)$ be the second fundamental form on an embedded $n$-manifold in the $(n+1)$-dimensional Euclidean space. Then the mean curvature $H$ is defined as the trace of $\mathrm{I\!I}( \cdot, \cdot)$ divided by $n$. But my question arises here. What does the trace of a bilinear form means, especially in the sense of a tensor field on a coordinate chart? Of course, considering $\mathrm{I\!I}(\xi^i g_i, \eta^j g_j) = \mathrm{I\!I}(g_i, g_j) \xi^i \eta_j$ gives us a matrix representation $h_{ij} = \mathrm{I\!I}(g_i, g_j)$ with respect to the contravariant basis. But if we take $H$ as a mere trace of this matrix $(h_{ij})$, we only have a quantity that is not invariant under the change of coordinate, which seems obviously undesirable. I know that I have trouble understanding the nature of $\mathrm{I\!I}( \cdot, \cdot)$, since the correct answer would be $(1/n)h_{i}^{i}$, where $h_{i}^{j} = h_{il}g^{lj}$. Is there any generous soul who can help me out from this conceptual messup?