Yes, there is a legal way. The easiest way is to order backup/reinstall media from this page on Dell's support site.
Alternatively, if you know anybody who owns a Windows 7 Home Premium disk, you can use theirs to do the reinstall, then enter the key on the computer's COA. If the disk you use to reinstall is from Dell, then you won't need to activate, because OEM disks activate automatically on computers from that manufacturer, but if it is a different manufacturer's disk or a retail disk, you will need to do activation. If it is not a Dell disk though you will likely need to call Microsoft in the process of activating. If you have access to a Windows 7 disk for a different version (Pro, Ultimate, etc.) you can create yourself an "any-version" installer disk and use that.