Demagnetization of transmitted electrons through a quasi-perpendicular collisionless shock