Hello, welcome to Just Answer.
Yes, that is the correct plug and gap.
Hunting, or surging, is generally caused by a lean condition. It most often means the carburetor needs to be disassembled and cleaned, or replaced. Has this generator been sitting for a while?
These carbs are very finicky, and cleaning sometimes is not enough. If cleaning it does not fix the problem, the carb must be replaced.
A quick test to see if the carb is the issue is to remove the air filter and spray a little extra gas into the intake while it is surging. If the extra gas causes the engine to smooth out, the carb is the most likely suspect.