First off, your basil has bolted, which means that it has sent out a long stalk with flowers on it and the plant is on its way to dying. This is part of the plant's life cycle and there's nothing you can really do about it. In future, remember that you can prolong a basil's life by pinching the flowers as soon as they appear. As to why this works, I gave an explanation in another answer
Remember that a plant's "mission" is to reproduce before it dies, to ensure the survival of its species (producing flowers is the first step). If you let the flowers stay till they drop off on their own, the plant, satisfied that it has successfully produced a flower, might decide to stop producing them (end of the flowering season).
However, when you remove the dead flowers you're sort of "tricking" the plant into thinking that its previous mission has failed (i.e., it hasn't produced a flower to ensure its survival).
"Tricking" the plant encourages it to produce more growth (and flowers too, which you should keep pinching/deheading).
Now coming to the yellowing part, that could be due to many reasons. The simplest explanation, given the advanced stage of bolting, is that the plant is in its last days. The other equally simple explanation is that you have over-watered the plant. Both these produce yellow leaves exactly like in your picture (the fact that the leaves are yellower closer to the base makes me think it is due to over-watering). Other not so simple explanations are fungal diseases or nutrient deficiencies, which are rather hard to diagnose for basil, because the reaction is the same (yellow leaves).
My suggestion would be to let this one run its course and be more careful with a new plant and don't let it bolt.