Fix a characteristic zero ground field. One can easily check that if $\mathfrak g$ is a simple Lie algebra, then the trilinear map map $\omega$ given by $$\omega(x,y,z)=B([x,y],z),$$ with $B$ the Killing form, represents a generator of $H^3(\mathfrak g,k)$.

Now, $H^\bullet(\mathfrak g,k)$ is an exterior algebra on a set of odd-degree elements according to a beautiful theorem of Chevalley-Eilenberg (this follows also from Hopf's calculation of the cohomology of the group attached to $\mathfrak g$, but C-E gave a purely algebraic proof). The number of generators is the rank of $\mathfrak g$ and their degrees are the numbers $2m_i-1$ with $m_i-1$ an exponent.

Are there nice formulas like the one above for $\omega$ for representatives of a set of generators of $H^\bullet(\mathfrak g,k)$?

`$d_i$`

here for your`$m_i$`

, since those are the degrees of basic invariants of the Weyl group`$W$`

acting on a related polynomial algebra. For instance, your cohomology degrees for type`$G_2$`

are 3 and 11, while the degrees of`$W$`

-invariants are 2, 6 (with product the order of`$W$`

). Anyway, a textbook reference for the cohomology theorem would help. $\endgroup$