“Duck Oil” or equivalent preserving-fluids are fine.
Don’t use WD-40 as that is a water-dispersant (the clue is in the initials!) that also dissolves oil, and its protection is limited. It’s mainly white spirit.
It is a good idea to lubricate it and move it about a bit every now and then, especially so if the cylinders, pistons or rings are cast-iron. In that case, a liberal oiling with thin lubricating-oil, and that moving the loco back and forth, is the best protection for those parts.