Section 27. If a convict serving a sentence of imprisonment in a jail or house of correction is convicted of a felony, the court may impose sentence of imprisonment in the state prison and order it to take effect forthwith, notwithstanding the former sentence. The convict shall thereupon be removed to the reception center established under section twenty of chapter one hundred and twenty-seven, and shall be discharged at the expiration of his sentence thereto.