Hi Wormwood. The terms of your Operating System licence almost certainly says you can only have it installed on only one computer at any time, so the answer to your questions are 1) No this is not legal. 2) Yes you can transfer the operating system from one hard drive to another.
You can switch hard drives as much as you like. You will have to reactivate Windows XP only if you make major changes to the PC. I think something like a moherboard change would come into that category, I don't know about a hard drive change.