To offset the loss of educated workers to “superstar cities,” more places are offering perks like relocation stipends and the option to work remotely.