Generators of the cohomology of a Lie algebra 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)$?

 A: 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 (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$.
A: For cohomology of $gl_n(k)$ (what is, essentially, the same as of $sl_n(K)$) the explicit formulas seem to go back to Dynkin (for reference and fascinating connection with other topics, see Kostant's account in his (well-known) paper "A theorem of Frobenius, a theorem of Amitsur-Levitski and cohomology theory", J. Math. Mech. 7 (1958), 237-264 http://www.iumj.indiana.edu/IUMJ/FULLTEXT/1958/7/57019 . See also Chap. 2, $\S 4$ of D.B. Fuchs, "Cohomology of Infinite-Dimesional Lie Algebras".
