There is currently no way to restrict movement to either the x-axis or the y-axis only. However, with snap lines enabled ("View" -> "Snap Lines", should be enabled by default), yEd will snap to the original x- or y-position when you move the node close enough to said original position. How close "close" is, is determine by the settings in "File" -> "Preferences", tab "Snap Lines".
Alternatively, enter desired coordinates for selected nodes directly in the properties table in yEd's lower right corner.