Should I bother with this 10-20 plug or replace it?
Is that plug safe, yes when properly wired there is no issue with that plug.
What would a best practice be when setting up a direct connection to a generator.
Change the plug to the appropriate 3 wire twist lock. The old plug will work but with motor loads vibrations can allow the plug to work out of the receptacle moving the plug from one source to another increases the chance the plug can vibrate out because of the stress on the wire being different.
The only real difference in today’s plug / receptacles is the ground lug each voltage hi / low has the ground lug pointing in or pointing out on twist locks.
a 120v 5-15 standard receptacle and plug 120v would work
Or a 6-15 240v 15a would also work but there is a higher chance for this plug to fall out, this is why I would suggest twist locks.
If you want to get fancy you could pay more and go to a 4 wire plug that is 120/240 rated but that is a waste because you won’t be changing your motor configuration but some folks have asked me to do this.
Last you are using a 5000w 240v generator, to power a pump with a book value 1657w (book values not nameplate is used for load calculations).
I would suggest to put in a simple interlock kit on your panel and an inlet to the panel and you could run your pump, refrigerator, Freezer and some lights off of that generator (my small backup generator is a 5000w welder and it runs all these loads) I turn the other breakers in the panel off and have had this setup for years. The issue I see with that large of a generator is fuel usage when not pumping.