Energy dependence and spectroscopy in the ¹⁶O(p, d)¹⁵O and ¹⁵N(p, d)¹⁴N reactions