Northampton came out on top of a high-octane 18-try thriller at home to Bath, the second highest scoring game in English top-flight history.