First of all, let me cite documentation about the difference between these two kinds of entities:
Persistent – instances of such entities are stored in the database using ORM.
Non-persistent – instances exist only in memory, or are stored somewhere via different mechanisms.
So the persistent entity is a natural choice if you want to represent data stored in a relational database table. On the other hand, if you need to represent data loaded, for example, from a web service, you need a non-persistent entity.
Now about your questions.
how I create these non-persistent entities
The same way as persistent ones - go to Data model section in Studio, click New > Entity and select Not persistent in Entity type field. Of course, you can do it right in the source code without Studio, but then you need some experience, and I would suggest first watching the changes made by Studio while you are using its visual interface.
if they are not persistent, can I generate windows in the same way?
For the UI framework, there is no difference between persistent and non-persistent entities, i.e. all UI components work with both ones in the same way. The difference is only in loading/saving the entities. For persistent entities, you can just specify a JPQL query in a collection datasource, and it will load the entities. For non-persistent entities, you need to do it programmatically by the obvious reason - the framework doesn’t know where to find your data. One of the ways of loading non-persistent entities is using
CustomCollectionDatasource like in this example.
You can generate a standard browser/editor screens for a non-persistent entity in Studio, but they won’t show any data - you need to handle it in the code.