The yields and production rates of the radioisotopes $^9$Li and $^8$He created by cosmic muon spallation on $^{12}$C, have been measured by the two detectors of the Double Chooz experiment. The identical detectors are located at separate sites and depths, which means they are subject to different muon spectra. The near (far) detector has an overburden of $sim$120 m.w.e. ($sim$300 m.w.e.) corresponding to a mean muon energy of $32.1pm2.0,mathrm{GeV}$ ($63.7pm5.5,mathrm{GeV}$). Comparing the data to a detailed simulation of the $^9$Li and $^8$He decays, the contribution of the $^8$He radioisotope at both detectors is found to be compatible with zero. The observed $^9$Li yields in the near and far detectors are $5.51pm0.51$ and $7.90pm0.51$, respectively, in units of $10^{-8}mu ^{-1} mathrm{g^{-1} cm^{2} }$. The shallow overburdens of the near and far detectors give a unique insight when combined with measurements by KamLAND and Borexino to give the first multi--experiment, data driven relationship between the $^9$Li yield and the mean muon energy according to the power law $Y = Y_0( <E_{mu} >/ 1,mathrm{GeV})^{overline{alpha}}$, giving $overline{alpha}=0.72pm0.06$ and $Y_0=(0.43pm0.11)times 10^{-8}mu ^{-1} mathrm{g^{-1} cm^{2}}$. This relationship gives future liquid scintillator based experiments the ability to predict their cosmogenic $^9$Li background rates.