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)$?
> 
> 
> 



Generators of the cohomology of a Lie algebra
The answer to your question is yes, at least for the classical Lie types. You can find the formulas in Section 6.19 of the book *Connections, curvature, and cohomology, Volume III: Cohomology of principal bundles and homogeneous spaces* by Greub, Halperin, and Vanstone (Pure and Applied Mathematics, Vol. 47-III. Academic Press, 1976). The formulas are provided on a type-by-type bases.


I've never seen explicit formulas written down for the exceptional Lie types, but my guess is that most of the generators can be obtained by embedding your Lie algebra in $\mathfrak{sl}\_n$ for $n$ sufficiently large, and then restricting the generators for $H^\bullet(\mathfrak{sl}\_n,k)$ to $H^\bullet(\mathfrak{g},k)$. In [one of my papers](http://arxiv.org/abs/1010.4696) (see Section 2.3) I work out some of the cohomological restriction maps for the exceptional types, but you might have to do some more work to figure out, say, explicit representatives for the generators when the Lie type is $G\_2$.


