This is a common experiment for microbiology courses and you can find instructions on the internet , here is an example from University of Wisconsin: http://inst.bact.wisc.edu/inst/index.php?module=Book&func=displayarticle&art_id=114
But the general method is measure optical density at regular intervals and plot them on a semilog graph, which has the normal linear scale on the X axis for time, but a base 10 log scale on the Y axis for optical density. You can set this up in microsoft excel or libreoffice calc by right clicking the y axis and going to format axis, there should be a logarithmic scale option somewhere depending on the version.
After you have the data plotted, the exponential growth phase should appear as a line with positive slope. The logarithmic scale on the Y axis will automatically transform the exponential curve into a straight line. To determine growth rate in terms of generation per hour, you need to get the optical density at time 0, which is the beginning of the exponential phase, and time t, which is just some other time on the exponential phase. Use this equation to determine growth rate: $k =\frac{log(X_t) - log(X_0)}{0.301t}$
Once you know the growth rate, you can determine the generation time with $t_{gen} = \frac{1}{k}$, which gives time for 1 generation in hours. To convert to minutes, just multiply by 60.
As a side note, remember to blank your spectrophotometer with sterile media. Also, if the optical density goes over 2 it won't be as accurate, so dilute the aliquots to make the optical density go below 2. Remember to record the dilution factor so you can multiply the density by the dilution and get back to the "original" optical density for plotting.