Select File-->Preferences... to open the Preferences dialog, then select the Grid tab.
Make a note of the Spacing setting. This determines the grid size. The default is 30.
Create your graph, with Grid enabled, to align your nodes to the grid.
Use Windows Paint or another drawing program to create an image with size set to the grid size, for example 30x30 pixels. This will be one square of the grid.
Select a thin drawing tool such as the pencil and a grid colour such as 50% Gray.
Put a single pixel in the top left of the image to create a grid of small dots. Or make the dot bigger if you wish. Or, draw thin lines along the top and left side to make a grid of lines.
Save the image as a .PNG file with an appropriate name. I use grid-dot-30.png and grid-line-30.png to show the style and size.
Again in yEd, select File-->Preferences... to open the Preferences dialog.
Select the Background tab, then select Image-->More... to pick the saved PNG file. Set Mode to Tiled. Click OK.
The screen should show the tiled background, but the alignment and spacing may appear to be incorrect. This will not affect the exported image.
Export the graph in JPG format or any other format. The background grid will be in the image.
If you wish to continue editing the graph in yEd and find the background distracting, change the Background in Preferences to No Image. You can easily set it back again when you want to export.