Spin-spin coupling-based quantum and classical phase transitions in two-impurity spin-boson models