Connect to a second computer at startup
Mac shared as a Time Machine backup destination

On the 'host/storage/backup' Mac


Go to System Prefs > Sharing
Enable File Sharing
Add a folder as the back up destination (note, you might want to partition a section of the HD for this) under "Shared Folders"
Right click, Advanced Options
Select "Share as Time Machine backup destination"


Then on the 'working' Mac, as long as both devices are visible to each other on the network, you should see the 'backup' Mac as a TimeMachine destination.

Source: https://support.apple.com/en-us/HT202784#mac