Boundary layer separation of hydromagnetic flows