If the input dml has record type simply do FBE will do.
If the input dml has no record type but with n as End of Record do a wc -l up front and pass the result back to the graph will do the trick.
Otherwise you need to assign a sequence number (next_in_sequence) using Reformat also capture the log port for the record count. Then:
Header: sequence number 1
Do a join with the source data (say in0) and from the record count capture from the previous Reformat log port (say in1).
Trailer: in0.sequencenumber in1.reccount