Lie cohomology of representations of nilpotent Lie groups and holomorphically induced representations