For example even when I'm holding my girlfriends hand I will get them
Do you get them just sitting around doing nothing? Or in public places with out your girlfriend there? The example you gave for random doesn't seem all too random considering you're holding hands with your girlfriend and maybe thinking about her. If it's something like you randomly think about something that arouses you then you just try keeping your mind occupied with different things.
getting random erections is fine... all part of being a man.. plus you are at an age where your hormones are kicking in. this is normal and as far as I know, you wont grow out of it for a while. guys get erections alot whether they have sexual thoughts or even spaced out. the thing has a mind of it's own... just be glad you know it works.