Instead of relying on expensive marketing, habit-forming companies link their services to the users’ daily routines and emotions.