Distinguishing modified gravity from dark energy