It just so happens that Mozart’s Variation 3 of his Sonata in A Major, K. 331, presents the challenge of playing parallel octaves in LEGATO (smooth and connected) And to make the task even more complex, the composer uses the A minor tonality, with F# and G# inserted into the passage fleshing out the MELODIC form. It can become a slippery slope in any case, no matter what key is assigned to a passage like this.
Taking these snatches from the piano literature serves a double purpose. It builds technique as it expands repertoire.
In the attached video I demonstrate ways to practice legato octaves in a step-wise manner, emphasizing the need for a good, facile fingering. In addition, a supple wrist and roll of the arm also helps a student navigate the tricky musical terrain.
Behind tempo practice is always recommended, with a deep physical, and ear-attentive connection to notes and phrases. In this case the octaves have to play out in curves, like the preceding line, which meanders along as a singular spun melody. One can consider the octaves to be a variant of this opening phrase.