Amplification on a relativistic electron beam in a spatially periodic transverse magnetic field