Evolution from the plasmon to exciton state in ligand-protected atomically precise gold nanoparticles