Cosmological phase space of generalized hybrid metric-Palatini theories of gravity