Gen Z and millennials left New York and Los Angeles at increased rates due to the high cost of living.