correct me if i'm wrong but heres how i understand it,
depending on the function/cheat,
a trainers works by modifying values in the ram,
i haven't played GTA
A but i played the previous ones, something like reduce wanted level would modify the values of ram in which the program reads in, this is the same technique for money and what not.
something like a graphic hack in bf2 though injects code into the graphics rendering to allow friendly players to colour blue and such.
thats how understand it, someone correct me if i'm wrong