This should work?
curl --dump-header /dev/fd/xxx https://google.com
or mkfifo headers.out
curl --dump-header headers.out https://google.com
unless I'm misunderstanding you.