This achievement is missable and can only be complete in Part 5. First, you need to need to examine the shackles at the front of LeChuck's ship with your magnifying monocle to obtain the serial number, this must be done in Part 2 or Part 3. Then, when you reach Part 4, give the serial number to Locke Smith to get a key made and use it in Part 5 to free Wally (and unlock the achievement).
Free Wally Achievement: