A traditional way to do it, is to use two variants of the query.
Includes paging, but setting the range and max results.
Doesn't.
In practice, the first query extends the second but adding the range filters, but when you request an export, the results of the second are streamed as a file, allowing for very large downloads. Furthermore you can select each row individually and dump it.
You should be able to use $query->iterate()
to fetch one at a time, although I haven't tested the behavior of this method, the documentation implies it doesn't load them all at once.
http://www.doctrine-project.org/api/orm/2.4/source-class-Doctrine.ORM.Query.html#563-577
A useful export form would be CSV whic you can write to using PHPs inbuilt functions.