Yes, it's legal and easily done. Note that you have two discs labeled Installer Disc 1 and Installer Disc 2. The former installs OS X. The latter contains the pre-bundled software - iLife.
You will need two 8 GB USB flash drives partitioned GUID and formatted Mac OS Extended, Journaled. You are going to clone the DVDs to the flash drives using Disk Utility.
1. Open Disk Utility in your Utilities folder.
2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
7. Insert one of the DVDs in the optical drive and wait until it mounts on your Desktop.
Clone using Restore Option of Disk Utility
- Select the destination volume from the left side list.
- Click on the Restore tab in the DU main window.
- Select the destination volume, again, from the left side list and drag it to the Destination entry field.
- Select the source volume from the left side list and drag it to the Source entry field.
- Double-check you got it right, then click on the Restore button.
Destination means the USB flash drive. Source means the mounted DVD drive.
Repeat this entire process for the other DVD. Be sure to label each flash drive so you will know which is which.