Yes Hey - the key will change if you move a scale
shape up the fretboard. If you shift EVERY NOTE of an A minor pentatonic scale up two frets, it will become B minor pentatonic. Same with chords. If you shift EVERY NOTE of an A minor chord up two frets (including any open strings), it will become a B minor chord.
But when you talk about moving up the fretboard to improvise while an E chord is being played, That's different. You don't want to change key or chord in that case or you risk a horrendous clash between the old chord and the new one. On behalf of your listeners, I request one chord at a time, please

.
So by all means move up the fretboard to improvise over an E chord, but don't drag up shapes from down below - because they won't be E based up there. You want to move up the fretboard and hit notes that still belong to the E major chord - or at least relate to it in some way. That means moving up to new shapes.