It's implementation-specific.
Typically, the location of variables will be based on all sorts of factors and optimizations. They may not live in RAM at all, as they may be optimised to live entirely within registers, or optimised away entirely.
Variable names don't exist at run-time; they're discarded during compilation. However, the compiler may emit debug information that's stored in the application binary, to allow the developers to debug the application. This is usually removed in release versions, though.
I have no idea about the specifics of Gameshark. But in many cases, the location of a particular variable can be figured out by taking a look at the machine code for the application.