Let $G$ be a compact Lie group and $\pi:P\to M$ a principal $G$-bundle. Since $G$ is compact, it has an embedding $G\hookrightarrow U(n)$ for some $n$. This embedding determines a unique principal $U(n)$-bundle over $M$ and hence we obtain Chern classes $c_k\in H^{2k}_{\mathrm{dR}}(M;\Bbb{R})$ for $k=1,\ldots,n$ (by applying the Chern-Weil homomorphism to the $U(n)$-invariant polynomials $\mathfrak{u}(n)\to\mathbb{R}$ obtained by expanding the function $\det(\lambda I-\frac{1}{2\pi i}X)$ in powers of $\lambda$).
To what extent do these cohomology classes depend on the choice of embedding $G\hookrightarrow U(n)$?
In other words, if $G\hookrightarrow U(m)$ is another embedding and we construct the respective Chern classes $\tilde{c}_k\in H^{2k}_{\mathrm{dR}}(M;\Bbb R)$, do we have $\tilde{c}_k=c_k$ for $1\leq k\leq\min(m,n)$ and all other classes are zero?
This certainly depend on the emebding. For instance let $G=U(1)$ the correspondant $C^n$ bundle splits as the sume of line budnles $L^{n_i}$ where the $n_i$ are the weight of the representation, and $L$ is the line bundle associated with the isomorphic representation $U(1)\to U(1)$. Thus the Chern character is the product $\Pi_i^n (1+n_ic)$. Something like this is true for the general case ; the computation reduces the case to the set of irreducible representations of $U(n)$.