Understanding Transfer Learning via Mean-field Analysis