You'll need to troubleshoot the issue, see what is happening when it is losing power. Is it losing fuel pressure? Fuel volume? Is the exhaust restricted? Do you have any diagnostic trouble codes stored in the engine control module? Is the transmission OK?
There's so much info missing here it's hard to know where to go from here except to say, don't replace the fuel pump again and try to diagnose the problem before replacing any other parts.