James Anderson rolled back the years with a five-wicket haul as Lancashire ended the second day of their opening County Championship match against Northamptonshire in a commanding position.