With subrecoil-laser-cooled atoms, one may reach nanokelvin temperatures while the ergodic properties of these systems do not follow usual statistical laws. Instead, due to an ingenious trapping mechanism in momentum space, power-law-distributed sojourn times are found for the cooled particles. Here, we show how this gives rise to a statistical-mechanical framework based on infinite ergodic theory, which replaces ordinary ergodic statistical physics of a thermal gas of atoms. In particular, the energy of the system exhibits a sharp discontinuous transition in its ergodic properties. Physically, this is controlled by the fluorescence rate, but, more profoundly, it is a manifestation of a transition for any observable, from being an integrable to becoming a nonintegrable observable, with respect to the infinite (non-normalized) invariant density.