OK, I have understood how it works. This is classical material but it seems difficult to find an answer in the literature for the non-specialist; so let me explain.

We consider the universal bundle $E U(n) \rightarrow B U(n)$ with fiber $U(n)$. Since $E U(n)$ is contractible, the Serre spectral sequence of the fibration gives information on the cohomology of $U(n)$. I recall that $H^{\bullet}(BU(n),\mathbb{Z}) = \mathbb{Z}[c_1,c_2,\dots,c_n]$, where $c_p$ is of degree $2p$. What the spectral sequence says is that to each $c_p$ corresponds a class $x_p$ in $H^{2p-1}(U(n),\mathbb{Z})$ which transgresses $c_p$.

In order to answer my question, we need to understand how to express these $x_p$ in terms of $c_p$.

Let $I = I(\mathfrak{u}(n))^{U(n)}$ be the space of invariant polynomials on $\mathfrak{u}(n)$. The Chern-Weil isomorphism $W$ gives that $I \cong H^{2\bullet}(BU(n),\mathbb{R})$.

If $P$ is of degree $l$ in $I$, we can consider the cohomology class $W(P)$ and transgress it to get a cohomology class of degree $2l-1$ in $U(n)$; denoting by $TP$ the class obtained, it can be shown that
$$ TP = \frac{(-1)^{l-1}}{2^{l-1} {2l-1 \choose l} } P(\omega \wedge [\omega,\omega]^{l-1})$$
(see equation 3.10 in Chern-Simons, Characteristic Forms and Geometric Invariants ; a minus one seems to be missing in the denominator).

The conclusion is that we have to know which invariant polynomials give integral classes on $H^{2\bullet}(BU(n),\mathbb{Z})$. But of course, these are just the polynomials used in order to compute the Chern classes of a vector bundle.

Since the polynomials that I consider in my question correspond to the Chern character, one has to relate the Chern character and Chern class in order to answer. Take $l=2$ for instance. We define the polynomial $ch_2(A) = \frac{-1}{8\pi^2}\text{Tr}(A^2)$. If $c_1$ and $c_2$ are the first and second Chern polynomials, one has
$$ ch_2 = \frac{1}{2}(c_1^2 - 2c_2).$$
The transgression $Tc_1^2$ vanishes so that $Tch_2 = Tc_2$ is an integral class (and this is optimal for the constant).

This gives that $\frac{1}{48\pi^2} \text{Tr}(\omega \wedge [\omega,\omega]) = \frac{1}{24\pi^2} \text{Tr}(\omega^3)$ is an integral class, as was claimed.

Edit ---
With the same method, one can compute the constants for $l=3$ but this is quite subtle. First, we define
$$ ch_3 = \frac{1}{6}(c_1^3 - 3c_1 c_2 + 3c_3)$$
so that $ch_3(A) = \frac{1}{6}\Big(\frac{1}{2\pi i}\Big)^3 \text{Tr}(A^3)$. The transgression of $c_1^3$ is zero and the transgressions of $c_1 c_2$ and $c_3$ are of course integral. This shows that the transgression of $2ch_3$ is integral.

Computing, this gives $T(2ch_3) = \frac{1}{24 \pi^3} \frac{1}{10} \text{Tr}(\omega^3)$. (I forget the $i$-factor)

If one uses Matthias formula, he will find that $\frac{1}{480 \pi^3} \text{Tr}(\omega^3)$ is integral, which is better by a factor $2$.

In fact, the class $c_1 c_2 - c_3$ is always even. This is one of the so-called Schwarzenberger condition. This shows that in fact $T(ch_3)$ is integral and explains the $2$-factor.

This discussion shows that the optimal constant can be difficult to obtain, from both methods (since indeed, there is no guarantee that the Hurewicz map maps to a non-divisible class). Anyway, the picture is very nice :-).

Remark that in general the formula of Matthias exactly says that the transgression of $ch_l$ is integral, which is not obvious to me.