It is not so easy with a fathership (acknowledgement of paternity) and custody of child in your case. Your girl friend hat a residence permit and the child will normally get it also, which means that you are interested in this fathership for the aim of staying in Germany. In such cases Standesamt or Jugendamt can't make the procedure of acknowledgement without previously informing the Ausländerbehörde in their place. Ausländerbehörde will start checking a possible abuse (if it's really your child or you are lying about it to get an advantage). The only way easily to prove that it is your child would be to make a DNA Test, after a positive result they don't need any more checking and you can procede with acknowledgement. But it is only possible after the birth.
Your girl friend can go to another country with her residence permit (although Corona makes it difficult). Perhaps you can try to make this acknowledgement in the country where you live now. On the other side you are illegal there and perhaps it will be a problem to contact the authorities. If you can do it with a notar there, I have no idea, you must ask them. Perhaps you can make a statement of paternity. But it can only be valid after your girl friend confirms it with the respective authorities in Germany, and I'm afraid, it possibly won't be allowed in your situation.
So after the birth, with a positive DNA Test, it would be much easier.
If you come to Germany, you can ask for a new Duldung with the aim to stay with or near the girl friend and the baby (then withe Ausländerbehörde in the place they live). Or you can make a new asylum application. In the second case you must be sent to the federal land in Germany where your first asylum procedure took place. From there you can ask for transfer to your child after the acknowledgement of paternity (anyway not during the pregnancy, the child must be already born). All these things are complicated and normally require support of a good lawyer with experience in foreign law (which naturally costs money). In any case I strongly recommend your girl friend to **** for a good councelling center for migrants in her area, because it is not only about you, it's about her and the rights of a future child to have a father.
As far as I understand, you don't have a passport (or don't provide it to the authorities). Depending on your country of origin, it would be difficult to deport you quickly, they will take measures forcing you to make a passport... In this time you can perhaps solve the problem of paternity documents.
There are also other aspects, like: if you come to Germany again, you will probably have a high penalty in a criminal procedure for coming illegally without documents. You have an important personal reason and a good lawyer can perhaps also help you with this problem.
It is not possible to discuss all aspects of such a case without a good personal consulting. Anyway, I wish you luck!
your old Duldung can't be simply prolonged in Germany if you come again after being illegally somewhere. If you come to stay with your girl friend or near her, you can apply for a