The punishments prescribed by this Code shall be assessed only after a legal adjudication of guilt in a court having jurisdiction.