This technique mimics the sound of a pedal steel guitar and is super frequent in country guitar soloing. Again, within the confines of G major, let's break down each position within the key, starting from the first, which highlights a G major triad.
The "target" tonality for each individual segment (which begins every half note) will be one chord lower in G major. For instance, the first measure features two "segments", the first highlighting G major, the second highlighting an F# diminished triad. The third segment (at the beginning of the second measure) targets E minor, and so on.
Focus on the pitch of the bends as written, as playing them incorrectly will cause nasty modulation.