Live Where You Thrive: Joint Evolution of Habitat Choice and Local Adaptation Facilitates Specialization and Promotes Diversity