This is something I wrote a while ago.
I found a small muffler with a heat shield at the local auto parts store (advance auto parts her in PA there part no. from the side of this muffler 18677 9 245 ) and used PC7 epoxt puty to temporally hold the corect mounting angles with respect to the muffler heat shield attaching to U shaped steel bent from 1 inch flat steel that I purched from home depo and bent into two big U shapes to mount to the bolts on the alternator (I had to put longer bolts on that side of the generator, and extend and move the ground wire to the other side of the generator). I used very long flexable hose clamps from NAPA, (two sets, each made of two of the longest they sell) to hold the muffler to the steel while the PC7 epoxy putty dried. After the epoxy cured I had a local auto shop weld the steel to the heat shield (make sure to ask them to be careful not to burn through the muffler when welding to the heat shield). I have a lathe so I was able to turn a piece of steel to make the cup shaped piece that I had welded to the end of the pipe and provide fit to the inside of the input pipe for the muffler. I now have a home made auto muffler adapted to this generator. It did reduce the noise considerably but the valve train, piston, and air intake still make quite a racket. Before it was louder than a gas lawn mower. Now it is not as loud as a gas lawn mower.
The way I added this muffler it moves with the generator and motor but still has the flex pipe for extra give.
I am now going to add a heat shield between the heat shield of the muffler and the generator for added protection of the generator.