Mechanisms for particle transfer and segregation in a turbulent boundary layer