Generalization with quantum geometry for learning unitaries