First things First , do not attempt the perfect boss runs until you have maxxed the Photon Launcher. Also if you get hit by the boss , simply die and continue and try again. The checkpoints are just before each boss in the game
Method for the Boss Fight
Start the fight with a solar punch ( Y button )and then start firing. As the boss charges you keep firing and dashing through him as he gets to you. He will now cover himself in Electricity and disappear. As soon as he appears run up to him and use a solar punch again followed by shooting him. As soon as he disappears be ready to jump and dash up to avoid his shots along the ground. Once you land continue shooting. He will once again get covered in electricity and disappear.
Do the same method and Jump and dash up to avoid taking any damage. He will now once again disappear and you will see him in the background. Once again when he appears hit him with a solar punch followed by shooting with your gun. The boss will now jump to the sky and start going around in circles , be sure to avoid him while shooting to kill him off. If he is going to hit you , you can also dash to avoid damage.