Equation to find specific gravity (or density) from a solution of sugar and water
Here an empirical approach:

1) A simple way to calculate density: mass/volume

mass = x g of sugar + (y L of water*1000 mL/L*1g/mL)

1 g/mL = water density

Then measure the total volume (total mL) of the mix:

density = (x g of sugar + (y L of water * 1000 mL/L * 1g/mL))/(total mL)

2) For the reverse calculation, you can determine density as a function of sugar content by preparing solutions with different sugar concentrations and use this to interpolate your specific density value to a sugar concentration.

You can also use preexisting tables or graphs as Felipe suggested