When you upgrade you give up the right to use your previous OS, but the key is still valid otherwise you wouldn't be able to reinstall.
In practice, in the past OS's there was no problem running both on the same machine. I doubt MS would be too concerned with someone keeping the old system running, after all you can only use one at a time.
Is it legal? probably not. I doubt MS would tell you it's ok to do it.