I've spent over fifty years of my life owning German Shepherd Dogs. I love the breed very much. They're great dogs to have when they're good, and not so great when they're not. A lot of it has to do with how they're handled and trained - it's often more about the owners than the dogs, as, in the right hands, a GSD may not act like that at all because a firm owner would be all over that at the very first hint it could be happening (but more work on prevention in the first place).
German Shepherds are sort of unique in that they're so intelligent and temperamentally strong, that if the owner doesn't completely run the show, then the dog will attempt to take over - his or her way. That is why they're a dog recommended for experienced owners, and rescues may not even consider someone without experience. Nor will they adopt out to homes with young children, or unfenced yards, etc. I've taken heat here over the years for saying that it's not a good idea to let dogs bite hands, or to win at tug of war, where dog is put into a situation of dog vs human, or to let them push past you and do things their way, etc. You can't do that with those dogs. They play games on your terms with you in charge at all times. You have to tell then what they can and can't do. All the time. The other thing is that they have to be exercised a great deal, both of body and mind, in order to let out their working energy.
Now please don't take this as "blaming". I almost didn't post because I was fearful that could happen. That's not my intent. I don't know you or the dog, but I'd like to help if I could, even if it's with understanding how this may have come about and if there's any hope of fixing it. So please take it that way. Above I posted a thread from the GSD forums that should be helpful for understanding. I will also post something else below.
Only you can know your own circumstances and whether you and the others in your household are willing and able to take on what needs to be done to turn this around, which is to take on a whole different way of living and being with this dog, with you completely in charge at all times. This is what you will learn from a trainer/corrective specialist. It won't work for the long haul unless you can follow through. If you can't then it might be better to go with one of your other plans while the dog is still young and before this gets worse. I know it will be heartbreaking for you to let the dog go, but it will be more heartbreaking if something happens and you are liable. Because that's the thing today, having a dog like this is a big liability unless you can keep one that's stable. (And by stable I mean one that's not going to cause harm.) And it often takes work to make one stable. (Although there are a handful that can be natural, friendly goofballs.) If you are working and leaving the dog home a lot, or are distracted with young children, it could be a very tall order to try to make it work safely. I do thing you are very wise to take this seriously now.
I'm pretty sure that what tazdev was talking about above when she said fear aggression is known as reactivity, or being reactive, which is fear based. I follow rescues from all over (been looking to rescue one myself) and so often when you read the stories, there is reactivity there, and it is very hard to live with. (I wouldn't knowingly take it on.) My last Shepherd was a sweetheart but reactive to other dogs, and it was a huge challenge to live with (but we did overcome it with education about it and lots of intervention, both professional and casual). I don't know if this is what's happening with your dog, but it could be. Read about it and see if you think it could be the case. There are things you can do about it, one of them being distraction - the dog has to be looking to YOU at all times for direction, not running of the rails doing his own thing. It takes a lot of work to train your dog to look at you instead of what he's reacting to, but it can be done. Of course, with people, it's more serious because a bite is just a moment or movement away, and you can't have that, especially if there are children, in particular visiting children, in your home. Unless you can be there every second, there could always be a risk. Again, I don't mean to sound doom and gloom, but I've lived this reality, too. One of our dogs (many moons ago) did bite a child and it was awful. That was a dog I had in childhood - as I became an adult I learned how important it was, and how to train, in order to have a stable GSD.
I really HTH. And hope surgery goes smoothly today. My current male dog was neutered four or five years ago and I saw him trying to hump a female in heat the other day at the dog park. (Why someone would bring a female in heat to the dog park is another subject for another day.) It made me wonder about hormones after neutering. Seemed to me there are probably still some floating around the body, perhaps from other organs. (Don't know enough about it off the top of my head and don't have enough energy to look it up today, lol, but thought it was interesting.)