To be honest I think the game function very well with only two players. In fact the best game I ever played was with just two people. I think it mostly comes down understanding the game mechanics that allow you to stop early attacks such as the air defense module and simply blocking their orders. If you're looking for ways to prevent super early aggression I have a few ideas...
Add a Planet
Obviously this will change a few dynamics in how special victories are can be obtained but this is actually a recommendation made in the expansion pack rule book. With this they recommend increasing the point limit but in a two player game one extra planet will make a pretty small difference and allow for more room to breathe before players are able to attack each other.
No Mobilize Orders on Home Planet
During the first planning phase don't allow players to place Mobilize orders on planets with other players home base. Going through a whole round without threat of attack is more than enough time to prepare adequate defenses.
Strategies to Prevent
Getting the air defense module severely limits the other players ability to be aggressive. By dropping your base on an area with a high supply cap (3 or 4) and getting the module, this makes it so that they have to land elsewhere on the planet first before they can attack your base. This allows you to be the attacker and arrange the fight how you want. Another thing to remember is that if they are building a lot of units early on they may be preparing for an attack. During this time investing in some better buildings or upgrades can lead to you have one better unit than them which could make their attacks very hard in the future if you hold them off.
Hope some of this helps. Like I said, I've played a fair amount of 1v1 games and they were actually quite fun. More people is a lot of fun but the game is definitely enjoyable with just two.
P.S. as was mentioned before the expansion pack has some great scenarios, one of which is specifically designed for two players. There are also a few new mechanics that I think help out with the problem you mentioned, in particular the defend order which makes stopping early aggression much easier.