Cohomologies of generalized complex manifolds and nilmanifolds