Adaptive Transformer Modelling of Density Function for Nonparametric Survival Analysis