Of course it isn't. Making such a statement is not attacking the country, it's attacking the state. To the left they're the same thing, but not to me.
An attack on the foundations of democracy is criticising democracy itself such as saying that democracy doesn't work and should be discontinued.
Claiming that it undermines democracy to say that democracy is being undermined, is only true if the claim is false. If a group have legitimately lost and refuse to accept it, that undermines democracy. If a group have illegitimately lost, it is their right to cry foul.
Though since there is no objective way to assess whether a claim is genuine or not, it's a judgement call as to whether you trust the state or not.
It's true that such talk is dangerous in the sense that it could lead to civil unrest or even civil war, but failure to speak out is just accepting dictatorship. I believe it's more dangerous to just meekly accept being screwed over.
If you BELIEVE that the FOUNDATIONS of our democracy are being RIGGED, you should speak out. However, because it IS dangerous, you should be absolutely POSITIVE about your claims.. Trump isn't positive.. In fact, he's MAKING it up as he goes along.. He has NO idea that his words are DANGEROUS... That would be NO IDEA at all..