Preferably the lambda function defined in the worksheet. Google Bard said to use the name() function, but there is no such function in Excel. Also tried the "Create from Selection" approach where the name is in cell A1 and the lambda function is in cell B1, but that doesn't work either.
The problem with defining it in the name manager "Refers to" field is the lambda function loses its formatting making it hard to read. Defining it in a cell would retain indentation and spaces but I haven't found a way for this to work... yet.