Local identifiers only exist if they're defined within the range of a procedure or trigger. This is true if the trigger is a developer-defined procedure, one of the default system triggers, or a standard application-supplied procedure.
Procedure-local identifiers and return values are declared in the definition of the procedure.
The Variables and Text Constants tabs for AL Locals are the same in use to the AL Globals when using the var keyword. The declaration of the AL Locals form can be seen in the following screenshot: