Magnetic characterization of the SPB/$\mathbf{\beta}$ Cep hybrid pulsator HD 43317