Exotic and excited-state radiative transitions in charmonium from lattice QCD