Alter existing route's output formats?
I found the solution myself.

I just created a new route with the requirement _format: json and the path /node/{node} just like entity.node.canonical. Then I could set a controller that is only called when the node is being output in JSON format.

My route definition looks like this:

entity.node.canonical.json:
  path: '/node/{node}'
  defaults:
    _controller: '\Drupal\my_module\Controller\NodeViewController::json'
    _title_callback: '\Drupal\node\Controller\NodeViewController::title'
  requirements:
    _entity_access: 'node.view'
    _format: 'json'