Potential formation triggered by field-aligned electron acceleration due to electron cyclotron resonance along diverging magnetic-field lines