Generally, you analyse music based on the key it is currently in, however there are cases where you can analyse in 2 keys at once(Specifically when modulating).
Say for Example you were in the key of C and modulated to G like so the chords could become something like:
C e am C | G e am C7 |G(now in the key of G)
In the 1st bar, you're clearly in C, but for the second you can either analyse in the key of C OR the key you are going to. Let's do that now
G e am C7
V iii vi I7(note that in C, the lasy Chord should be CM7 instead)
G e am C7
I iv ii V7
notice that the shared chords between C and G make this progression not only fit with G major, but actually fit better than with c major!
in notation from what I know the whole thing would likely be notated like so
C e am C| G e am C7|G
I iii vi I| V iii vi I7|I
I iv ii V
and in that case as you can see, there are 2 keys being analysed at the same time. Hope that helps :)