The squid already had its head chopped off before serving, but the legs are moving as a result of the sodium-containing soy sauce. Muscles contract in response to signals from neurons, which transmit signals around the body by means of a series of sequential influxes of sodium across the cell membrane into the neuron. With this excess of sodium from the soy sauce, it's like a simulated signal activating the muscles.