No it is not illegal
The Supreme Court recently in ICICI Bank Limited v. Official Liquidator of APS Star Industries Ltd. has reversed the decision of the Gujarat High Court holding that inter-se transfer of Non Performing Assets (NPA) by banks is not illegal under Banking Regulation Act, 1949. The High Court had held that "assignment of debts by banks inter se is not an activity which is permissible under the said BR Act, 1949 and consequently all executed contracts of assignment of debts were illegal."
For more details please go through the link mentioned below..
https://legalperspectives.blogspot.com/2010/10/inter-bank-transfer-of-npas-not-illegal.html