Maurer-Cartan 1- form as a connection 1-form

I'm trying to decipher a differential geometric comment on page 23-24 of Berline, Getzler, and Vergne's "Heat Kernels and Dirac Operators".

Take a trivial vector bundle $E \times M$ in a manifold $M$ with connection $\nabla = d + \omega$ where $\omega$ is an $End(E)$-valued 1 form. Let $g: GL(E) \to End(E)$ be the tautological map sending a linear map in $GL(E)$ to itself as an element of $End(E)$. The claim is that the connection 1-form on the (trivial) frame bundle for $E \times M$ is given by $g^{-1} \pi^* \omega g + g^{-1} d g$. In particular, if $\omega = 0$ then we get that the trivial connection on the trivial bundle is the Maurer-Cartan 1-form. Unfortunately, I don't see how to give a convincing proof of this - can someone help?

Let $G = End(E)$. I think the best way to see the given formula is to first look at what $A$, the connection on $P:=G \times M$, must be at $(e,x)$. We have naturally $T_{(e,x)} P \simeq T_e G \oplus T_x M$. As $A$ is a connection, it must take a vertical element to the corresponding element in $\mathfrak g$. Therefore its restriction to $T_e G \simeq \mathfrak g$ must be the identity. Now it is only natural to define $A_{(e,x)}$ on $X \in T_x M$ to be $\omega(X)$. Therefore we have $$A_{(e,x)} = \pi^* \omega + dg.$$ But now the general formula follows from the equivariance condition of $A$, namely $A_{(g,x)} = Ad_{g^{-1}} A_{(e,x)}$.