Suppose we have a principal $G$ bundle $(P,M,π)$ where $M$ is a 4-dimenational manifold and $G$ a Lie group (and $\mathfrak{g}$ its Lie algebra).The Yang Mills action is a functional of the gauge potential $A$ (which is nothing more than the connection on the principal bundle), expressed in terms of the curvature $F=DA=dA +A\wedge A$ of the connection. I know there is an isomorphism between $\mathfrak{g}$-valued tensorial forms of type $Ad$ ($Ad$ is the adjoint representation) and forms on $M$ with values on the Adjoint Bundle $P \times _{Ad} \mathfrak{g}$, so my understanding is that in the YM action: $$S_{YM} = \int_M \frac{1}{2} \operatorname{tr}(F \wedge \star F) $$ this $F$ is not the curvature, but the image of the curvature 2-form (which is tensorial of type Ad) under the aforementioned isomorphism, is this correct? This is my frist question.
Now in the case where $P$ is a trivial bundle, there is a global section $s:M \to P$ and the local curvature form $$ F_s = s^* F $$ is actually defined globally on $M$ and in coordinates it is $F_s=\frac12 F_{μν} dx^μ \wedge dx^n $ . So the action takes the more familiar form: $$ S_{YM}=\frac{1}{4} \int_{M} \operatorname{tr}\left({F}_{\mu \nu} {F}^{\mu \nu}\right) vol$$My second question is, how is this global local-form $F_s$ related to the one we get from the above isomorphism? They are the same up to a gauge transformation?
My third question is, what do we do when the bundle is not trivial. We can still make the local curvature, but we have more than 1. However the isomorphism guarantees there is a global form on $M$ as the picture of the curvature (which is what's inside the action integral right?), so how is this related to the local ones? Also, the derivations of the Yang Mills equations I've seen all use coordinates, but how can we express the integral if we need more than one coordinate charts due to non-triviality?