ok in the third movie you hear Darth Sidous say, ill show you how to prevent yourself or the ones you love from dying. Then goes on to say that he does not know the secret but together that they would find the answer, no where in any of the movies does it show them learning this ability but i guess in the time lapse from the third movie to the sixth they must have had found how to accomplish this. Also think of it this way, in the First star wars movie, Palpatine must have been in his 60s or 70s and then in the sixth book which you would have to assume is atleast 30 years later (based on the apparent age of luke skywalker) therefore making Sidious atleast 90 years old. Kind of hard to still be strong in the dark side of the force being that age and able to move nimbly. So that also shows that they learned this "life extending" ability.