First, enable auto-design in the options screen.
Then, in the shipyard screen, hit the Focus button (it should be lit up if auto design is enabled) and set the sliders according to what weapons and defences you would prefer to see in the generated designs.
As you research new technologies the settings you've picked in the Focus screen will automatically redesign your ships.