Specialization of modules over a local ring