He trains for around 6 months with Whis, and during this time, he seems to increase his power enough to generate the SSG form himself. As he watches SSG Son Goku, I postulate that he is in fact beginning to sense Son's godly ki, and training himself to be able to not only sense it, but eventually replicate its godly nature. This is the main inference: He has spent so long fighting and training with Goku, that he knows his ki almost as well as his own. While Beerus is fighting with SSG Son Goku, we notice Vegeta closely watching, and as the fight goes on, he seems to almost be able to sense Goku's godly ki. What this tells us is that Vegeta himself has the capacity for the sheer amount of power of the SSG form. When Vegeta first fights Beerus and Bulma is slapped, Vegeta then gains a massive power boost, and fights Beerus off very successfully for some time. The Wiki never quite answers it, however several inferences can be made from the Anime (since the Manga for DBS is based on the Anime, not the other way around): The training both Goku and Vegeta are undergoing, which deals with raising power levels, a manifestation of Ki, without letting it leak, or, in other words, letting the opponent know, making each part of the body capable of independent action and also the perception and mastery of divine Ki, thus mastering SSG, SBG (Saiyan Beyond God) and SSB transformation. What they managed to do can be thought of controlling the SSJ1 Ki and making it flow evenly through their bodies, thus mastering the form. The FPSSJ transformation was the mastering of SSJ1 and making it the base form, thus reducing the strain on the body and making it easier to raise power levels.
It's similar to that incident when Goku and Gohan had unlocked the Full Power Super Saiyan transformation after training in the hyperbolic time chamber in the cell saga. Goku even states that Vegeta's Ki had changed a lot during the six months he had spent training under Whis ( watch here). There is reference to this in the anime when he senses the return of Whis ( watch here), and later the oracle fish comments that he's finally able to sense divine Ki. As Vegeta said that he mastered the SSG form, I would believe it and would further add that by mastering the form he said that he mastered the perception and usage of the divine Ki, thus making it flow through his body evenly and unlocking the SSGSS form. As a result, you can even absorb energy attacks. The SSG form is just another Saiyan transformation, the only thing being different is that instead of normal Ki, there is divine Ki flowing through your body and you can even perceive it now. However, as it wasn't done before Vegeta went off to train under Whis, the only options left are that either he performed the ritual on that planet, or his training with Whis helped him do so. That is, that to achieve SSGSS, one must achieve and master SSG first. Super Saiyan God Super Saiyan, also known as Super Saiyan Blue, is the result of a Saiyan transforming into a Super Saiyan after absorbing and retaining the power of Super Saiyan God and training.