The dynamics of preference formation