I think that "pescado" is the participle form of the verb "[pescar][1]", which means "to fish", so I guess that once that you _fish a fish_ it turns from "pez" to pescado".

> **Pescar:** Sacar o tratar de sacar del agua peces y otros animales útiles al hombre

So the difference is not that the creature is alive or cooked, it is that has been "harvested" from the sea/river/lake/etc. by human hand.

You could see a lot of dead fish on the sea shore and you would still refer to them as "peces", not as "pescados". Once a fish is cooked or ready to be eaten supposedly has been fished first, so it is called "[pescado][2]".  

> **Pescado**: _Pez_ comestible _sacado del agua_ por cualquiera de los procedimientos de pesca.


[1]:http://lema.rae.es/drae/srv/search?key=pescar
[2]: http://buscon.rae.es/drae/srv/search?id=o2SmrMhjQDXX2Sf9gXQQ