In the 1.8.13 version Arduino IDE I can add this line to preferences.txt:
build.path=/home/username/Arduino2/build
and this will cause the files generated by the compilation process to be deposited in the "build" directory per
the path on the right side of the =.
It doesn't appear to work when I run IDE 2.0. The build directory remains empty.
Does the IDE 2.0 even use the preferences.txt file? Another file or mechanism to set this type of option?
My main purpose is to get the "map" file for inspection of binary sizes.
Unfortunately, I'm not aware of a way to customize the build directory on Arduino IDE 2.x. You can save the binaries to the build subfolder of the sketch folder via Sketch > Export Compiled Binary, and I know the boards platform can be configured to make that feature also export other useful files (e.g., ATTinyCore also exports the assembly listing), but there's not guarantee the boards platform you're using is already configured to do that. You could certainly modify the platform to do it, but I don't know whether you want to go there.
What I would like to see happen eventually is for the Arduino CLI configuration system to be expanded to cover all useful settings. This functionality you're missing is more of a deficiency in Arduino CLI than in Arduino IDE 2.x, since Arduino CLI is responsible for all non-GUI tasks.