Lexicographically Fair Learning: Algorithms and Generalization