Regions, frictions, and migrations in a model of structural transformation