It should be possible to list both affiliations. While I have not worried about this myself, I do remember going to a seminar at UPenn in the summer between my PhD and my postdoc. My introduction included both affiliations. I was a little surprised (and pleased) by that and kept an ear out for it afterwards: it is a reasonably common thing to do.
Why do you list affiliations at all? Here are some reasons.
1) It gives readers a chance to contact you.
2) Some employers require or request that you mention them. If they are providing you with financial support, this seems reasonable. (Especially if you signed a contract saying you will!)
3) You give yourself a veneer of legitimacy/prestige that can (unfortunately) help your submission get taken more seriously. Often by doing this you telegraph to insiders who your famous thesis advisor is, which could (unfortunately) get you more alacrity and respect in the processing of your paper.
To address these: I think 1) is almost obsolete. If you are an untenured academic, you should have a webpage. Then anyone who reads one of your papers types "T....K.... math" into google, and presto, they can contact you. By the way, if you are transitioning from one temporary job to another, then neither affiliation is going to be very useful in the long term. I have papers which tell readers that they can reach me at "Montreal" and "MSRI": the latter might have been true for a month or two, but no longer.
2) is serious of course, but if you are between affiliations you are probably not being financially supported by either one. It may be though that you are just putting the finishing touches on work that you did at the first institution. That's a good reason to list the first institution. The fact that it doesn't make much sense to list an institution that you are no longer affiliated with instead of an institution that you are currently affiliated with is then a good reason to try to list the second institution as well.
3) Well, what's more prestigious than any one academic institution? The answer seems obvious...
Let me briefly respond to something written by @adipro:
If you put your postdoc affiliation, it would give the wrong impression that the paper is a product of your postdoc, and your postdoc affiliation, rather than your PhD affiliation, wrongly gets the credit.
The OP is a mathematician, and math papers are not products of their institutions. Listing an institutional affiliation means exactly that: you have (or had, during part of the period when the work was done or the paper was written) an affiliation with that institution. (It doesn't even necessarily mean that you had financial support from them, although that is usually the case.) None of the institutions at which I was a postdoc can or do claim any ownership or credit for any of the papers I wrote while I was there. They get to record for all time that they had the good judgment to hire someone who went on to a tenure-track job, which one of them does.