But it isn't just the nominal allegiance brigade who are declining in numbers, it is also those who see religion as important to them and also are actively involved in religion. Certainly this is the case for the UK, and indeed for most developed countries where there is freedom of religion.
So the notion that religion is in robust health, just that the 'census' christian-types are less likely to tick the box, is not credible and not backed up by evidence.
The problem with this argument is that no-one really knows what the core numbers, as opposed to the nominal numbers, were say 50 years ago. What we do know is that, in the early 20th century, our 'Christian nation' had a pretty low level of church attendance (see the records for the 1904 Revival in Wales, for instance - one book I read some years ago suggested an attendance rate of 1 in 10 was 'good'. (I'll try to find it again - if its still in the library at church). The numbers actively involved in religion don't always correlate with those attending places of worship, at both extremes. For instance, by the end of the 70s, the number of Christians in Nepal was in the region of 5000, with about half of these living in remote villages and with no other Christians in the village. This meant that they were Christians who were not attending a place of worship as we understand the term.
Similarly, if we look at UK churches of the same era, many would have said that perhaps half their attendees were there because their families had been attending for generations and it was socially acceptable for them to do so. We now have the interesting anomaly that some parents attend church purely to establish their credentials prior to getting their chlid(ren) into a faith school, because of the high reputation of such schools. It is no different, really, to parents who seek to have an address in the catchment area of a high reputation state school (primary especially) only then to 'move out of' (if they ever really moved into) the area once they have acheived the aim of getting their child into that school.
The other thing is that attendance doesn't necessarily equate to allegiance to a faith. At the church we attend, I would suggest that 5-10% of the regular Sunday attendees (~350) are those who are looking at the faith and seeing whether it has anything for them. There is also approaching a 15% group of the membership who never attend church, because they are housebound and without any means of getting to the church or who work away from the locality temporarily. (By the way, having been on the church leadership until last April - these are rounded figures that we were given about a year ago)