If an incarcerated individual is entitled to a diminution of the incarcerated individual’s term of confinement under this subtitle and is transferred to a hospital or mental institution, the incarcerated individual may not be denied credit authorized by this subtitle.