Actually, I had wondered the same. I suspect you cage and trade the pet to the person with the stone, let them learn and upgrade, then they cage it and trade back?
Wouldn't it be nice if they worked something like enchants? So you call out the pet you want upgraded and I cast my stone on it. Kind of like a priest giving a blessing.