Fuel delivery issue

I have a 2006 Sportsman 500 2x.
It seems to want to run out of fuel and quit at lower rpm’s and a little at higher rpm’s. Do you think it is the fuel filter? If so do you have an after market replacement?
Do you think it is the fuel pump in the fuel tank? I don’t want to replace the whole fuel tank/pump for $750. Is there an after market pump or can you install an external pump somewhere inline. I know the fuel pressure is approx. 40 psi.

Thanks