Cosmology in generalized Proca theories