It's just a good fit on a taper, best to leave the chain on, remove nut and washer and turn engine while at the same time applying (gentle) sideways force to sprocket, ( like a very small pry bar behind sprocket).
You could heat the sprocket prior to this with a heat gun if you have one, it's not usually a great problem to remove.
If you have unlimited funds take the sprocket off the dynamo as well, throw both of them in a bin and buy a toothed belt system.
all the best - Bill