Lawyers are leaving their legal departments, in many cases to join the law firms they’ve worked with as outside counsel.