The simplest would be to redirecting the output or the correlation matrix (using the flag -r) to a text file.
r.covar -r map=raster1@PERMANENT,raster2@PERMANENT > covar.txt
You have to run it from the Grass command line or from the Grass console in GUI to have the output in a text file. The output is an 2 x 2 symmetric covariance (correlation) matrix.
Please note that the text file will be saved in your present Grass directory. Check it in the Grass command line.
If you are using script in Python, it would be something like -
import grass.script as gscript
covar = gscript.parse_command('r.covar', flags='r', map=('raster1@PERMANENT','raster2@PERMANENT')