Shock-induced phase transition in systems of hard spheres with internal degrees of freedom