A two-billion-year history for the lunar dynamo