This question has been answered by leffyrant. See the first response.
public function beforeSave() {
// Creating the secondary object.
$primary_id = $this->object->get('id');
$secondary_id = $this->getProperty('secondary_id');
$secondary = $this->modx->newObject('Secondary');
$secondary->set('id', $secondary_id);
$secondary->set('primary_id', $primary_id);
// Adding the secondary to the primary.
$this->object->addOne($secondary);
return parent :: beforeSave();
}