Extract Instance Variable is a refactoring that converts the selected expression to an instance variable of the class.

Place the caret at a local variable or select an expression to apply the refactoring to:

Extract Instance Variable

and press &shortcut:IntroduceField; (Refactor | Extract Instance Variable).

This will result in the following:

Extracted Instance Variable