Magnetic field measurements in a sample of Class I and flat-spectrum protostars observed with SPIRou | Synapse