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?