A symmetry approach to geometric phase for quantum ensembles