If $\{U_{\gamma}\}$ is an open cover of $X$ which trivialises $E$, then over $U_{\alpha}$, there are sections $s_1, \dots, s_m$ such that $\{s_i(x)\ |\ i = 1, \dots, m\}$ is a basis for $E_{x}$ for every $x \in U_{\alpha}$ ($m$ is the rank of $E$). Suppose now that $x \in U_{\alpha}\cap U_{\beta}$, and let $\sigma_1, \dots, \sigma_m$ be the corresponding sections; in particular $\{\sigma_i(x)\ |\ i = 1, \dots, m\}$ is also a basis for $E_x$. Then there is a change of basis matrix $g_{\alpha\beta}(x)$ which transforms $\{\sigma_i(x)\ |\ i = 1, \dots, m\}$ into $\{s_i(x)\ |\ i = 1, \dots, m\}$; that is $s_i(x) = g_{\alpha\beta}(x)\sigma_i(x)$ for $i = 1, \dots, m$.
A choice of metric on $E$ gives an inner product $\langle \cdot, \cdot\rangle_x$ on $E_x$. This allows us to measure angles; in particular, we can apply the Gram-Schmidt process to obtain an orthonormal basis for $E_x$. Therefore, we can take both $\{\sigma_i(x)\ |\ i = 1, \dots, m\}$ and $\{s_i(x)\ |\ i = 1, \dots, m\}$ to be orthonormal bases for $E_x$. Note that
$\delta_{ij} = \langle s_i(x), s_j(x)\rangle_x = \langle g_{\alpha\beta}(x)\sigma_i(x), g_{\alpha\beta}(x)\sigma_j(x)\rangle_x,$
and
$\delta_{ij} = \langle\sigma_i(x), \sigma_j(x)\rangle_x.$
Therefore $\langle\sigma_i(x), \sigma_j(x)\rangle_x = \langle g_{\alpha\beta}(x)\sigma_i(x), g_{\alpha\beta}(x)\sigma_j(x)\rangle_x$, so $g_{\alpha\beta}(x)$ preserves the inner product and is therefore an element of the orthogonal group.