Beryllium Radioactive Isotopes as a Probe to Measure the Residence Time of Cosmic Rays in the Galaxy and Halo Thickness: A "Data-Driven" Approach