[step:Define the projection and the local trivializations]
Define $\rho:P \to M$ by
\begin{align*}
\rho([(x,h)_i]) := x.
\end{align*}
This is well-defined because equivalent points have the same base point by the definition of $\sim$.
For each $i \in I$, define $\Phi_i: \rho^{-1}(U_i) \to U_i \times G$ by
\begin{align*}
\Phi_i([(x,h)_i]) := (x,h).
\end{align*}
This map is well-defined on $\rho^{-1}(U_i)$ as follows. If the same class is represented by $(x,k)_j$ with $x \in U_i \cap U_j$, then the defining relation gives
\begin{align*}
(x,k)_j \sim (x,g_{ij}(x)k)_i,
\end{align*}
so the representative in the $i$-th chart is uniquely $(x,g_{ij}(x)k)_i$.
The inverse map $\Psi_i: U_i \times G \to \rho^{-1}(U_i)$ is defined by
\begin{align*}
\Psi_i(x,h) := [(x,h)_i].
\end{align*}
The identities $\Phi_i \circ \Psi_i = \operatorname{id}_{U_i \times G}$ and $\Psi_i \circ \Phi_i = \operatorname{id}_{\rho^{-1}(U_i)}$ follow directly from the definitions, so $\Phi_i$ is a bijection.
On an overlap $U_i \cap U_j$, the coordinate transition map
\begin{align*}
\Phi_i \circ \Phi_j^{-1}: (U_i \cap U_j) \times G &\to (U_i \cap U_j) \times G
\end{align*}
is given by
\begin{align*}
(x,h) \mapsto (x,g_{ij}(x)h).
\end{align*}
This map is smooth because $g_{ij}:U_i \cap U_j \to G$ is smooth and multiplication
\begin{align*}
G \times G \to G
\end{align*}
in the Lie group $G$ is smooth. Its inverse is
\begin{align*}
(x,h) \mapsto (x,g_{ji}(x)h),
\end{align*}
which is smooth for the same reason.
Declare a subset $A \subset P$ to be open if and only if $\Phi_i(A \cap \rho^{-1}(U_i))$ is open in $U_i \times G$ for every $i \in I$. We will apply the standard smooth manifold atlas construction theorem: a set equipped with bijective charts to open subsets of Euclidean-space manifolds, smooth transition maps, and a Hausdorff second countable chart topology has a unique smooth manifold structure for which those charts are diffeomorphisms. The transition maps computed above are smooth diffeomorphisms, so it remains only to verify the Hausdorff and second countability axioms for this chart topology.
The topology is Hausdorff. Let $p,q \in P$ be distinct. If $\rho(p) \neq \rho(q)$, choose disjoint open neighbourhoods $V,W \subset M$ of $\rho(p)$ and $\rho(q)$, respectively, using that the smooth manifold $M$ is Hausdorff. Since $\rho$ is locally the projection $U_i \times G \to U_i$, the sets $\rho^{-1}(V)$ and $\rho^{-1}(W)$ are open in $P$ and separate $p$ from $q$. If $\rho(p)=\rho(q)=x$, choose $i \in I$ with $x \in U_i$. Then $p,q \in \rho^{-1}(U_i)$, and $\Phi_i(p) \neq \Phi_i(q)$ in the Hausdorff manifold $U_i \times G$; disjoint open neighbourhoods of $\Phi_i(p)$ and $\Phi_i(q)$ pull back under $\Phi_i$ to disjoint open neighbourhoods of $p$ and $q$.
The topology is second countable. Since $M$ is second countable, every open cover of $M$ has a countable subcover; choose a countable subset $J \subset I$ such that $(U_j)_{j \in J}$ still covers $M$. For each $j \in J$, let $\mathcal{B}_j$ be a countable basis of the second countable manifold $U_j \times G$. Then
\begin{align*}
\mathcal{B} := \{\Phi_j^{-1}(B) : j \in J \text{ and } B \in \mathcal{B}_j\}
\end{align*}
is countable. It is a basis for $P$: if $A \subset P$ is open and $p \in A$, choose $j \in J$ with $\rho(p) \in U_j$; then $\Phi_j(A \cap \rho^{-1}(U_j))$ is open in $U_j \times G$, so some $B \in \mathcal{B}_j$ satisfies $\Phi_j(p) \in B \subset \Phi_j(A \cap \rho^{-1}(U_j))$, hence $p \in \Phi_j^{-1}(B) \subset A$.
Therefore $P$ is a smooth manifold and each $\Phi_i$ is a diffeomorphism onto $U_i \times G$. Since $\rho$ is expressed in the chart $\Phi_i$ as the projection $U_i \times G \to U_i$, namely $(x,h) \mapsto x$, the map $\rho:P \to M$ is smooth.
[/step]