Thermodynamic behavior of the generalized scalar Yukawa model in a magnetic background