You bring somebody in the sleep lab, you put electrodes on their scalp and you see what these-- what sort of electrical activities you get in the brain.
It is the movement of potassium (and also sodium) ions that causes the electrical impulses that nerve cells carry including the impulses found in slow-wave sleep.